Browse Source

无jira任务 fix: 修改下preserveMetadata配置的效果

release/11.0
Afly 2 months ago
parent
commit
e7ef7f5871
  1. 2
      src/main/java/com/fanruan/fs/s3/repository/core/S3ResourceRepository.java

2
src/main/java/com/fanruan/fs/s3/repository/core/S3ResourceRepository.java

@ -175,7 +175,6 @@ public class S3ResourceRepository extends BaseResourceRepository {
metadata = s3.getObjectMetadata(bucket, path); metadata = s3.getObjectMetadata(bucket, path);
} catch (Exception ignore) { } catch (Exception ignore) {
} }
}
if (metadata == null) { if (metadata == null) {
metadata = new ObjectMetadata(); metadata = new ObjectMetadata();
String mimeType = URLConnection.guessContentTypeFromName(path); String mimeType = URLConnection.guessContentTypeFromName(path);
@ -184,6 +183,7 @@ public class S3ResourceRepository extends BaseResourceRepository {
} }
} }
metadata.setContentLength(length); metadata.setContentLength(length);
}
s3.putObject(bucket, path, new ByteArrayInputStream(data), metadata); s3.putObject(bucket, path, new ByteArrayInputStream(data), metadata);
} }
} }

Loading…
Cancel
Save