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