From a43eb7222eb8d1d1bdb48f25220dae067e9793e6 Mon Sep 17 00:00:00 2001 From: Zed Date: Thu, 29 Oct 2020 14:02:49 +0800 Subject: [PATCH] =?UTF-8?q?DEC-15615=20fix:=20read=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E4=B8=8D=E8=83=BD=E6=8F=90=E5=89=8D=E5=85=B3=E9=97=AD=EF=BC=8C?= =?UTF-8?q?=E9=9C=80=E8=A6=81=E8=B0=83=E7=94=A8=E8=80=85=E5=9C=A8=E5=A4=96?= =?UTF-8?q?=E9=83=A8=E4=BD=BF=E7=94=A8=E5=AE=8C=E4=B9=8B=E5=90=8E=20?= =?UTF-8?q?=E5=8F=8A=E6=97=B6=E5=85=B3=E9=97=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fs/s3/repository/core/S3ResourceRepository.java | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/main/java/com/fanruan/fs/s3/repository/core/S3ResourceRepository.java b/src/main/java/com/fanruan/fs/s3/repository/core/S3ResourceRepository.java index 1151979..78368e9 100644 --- a/src/main/java/com/fanruan/fs/s3/repository/core/S3ResourceRepository.java +++ b/src/main/java/com/fanruan/fs/s3/repository/core/S3ResourceRepository.java @@ -121,12 +121,7 @@ public class S3ResourceRepository extends BaseResourceRepository { public InputStream read(String filePath) throws ResourceIOException { GetObjectRequest request = new GetObjectRequest(bucket, filePath); try { - S3Object s3Object = s3.getObject(request); - try { - return s3Object.getObjectContent(); - } finally { - s3Object.close(); - } + return s3.getObject(request).getObjectContent(); } catch (Exception e) { return new ByteArrayInputStream(new byte[0]); }