|
|
@ -121,12 +121,7 @@ public class S3ResourceRepository extends BaseResourceRepository { |
|
|
|
public InputStream read(String filePath) throws ResourceIOException { |
|
|
|
public InputStream read(String filePath) throws ResourceIOException { |
|
|
|
GetObjectRequest request = new GetObjectRequest(bucket, filePath); |
|
|
|
GetObjectRequest request = new GetObjectRequest(bucket, filePath); |
|
|
|
try { |
|
|
|
try { |
|
|
|
S3Object s3Object = s3.getObject(request); |
|
|
|
return s3.getObject(request).getObjectContent(); |
|
|
|
try { |
|
|
|
|
|
|
|
return s3Object.getObjectContent(); |
|
|
|
|
|
|
|
} finally { |
|
|
|
|
|
|
|
s3Object.close(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
} catch (Exception e) { |
|
|
|
return new ByteArrayInputStream(new byte[0]); |
|
|
|
return new ByteArrayInputStream(new byte[0]); |
|
|
|
} |
|
|
|
} |
|
|
|