diff --git a/build.gradle b/build.gradle index 82be02f..1a91eab 100644 --- a/build.gradle +++ b/build.gradle @@ -51,5 +51,5 @@ publishing { } group 'mil.army.usace.hec' - version '0.0.55' + version '0.0.56' } diff --git a/src/main/java/usace/cc/plugin/FileDataStoreS3.java b/src/main/java/usace/cc/plugin/FileDataStoreS3.java index 4cab661..b9d0bf4 100644 --- a/src/main/java/usace/cc/plugin/FileDataStoreS3.java +++ b/src/main/java/usace/cc/plugin/FileDataStoreS3.java @@ -47,36 +47,18 @@ public Boolean Copy(FileDataStore destStore, String srcPath, String destPath) { } @Override public InputStream Get(String path) { - //byte[] data; + S3Object fullObject = null; + String key = postFix + "/" + path; + System.out.println(path); + System.out.println(bucket); try { - S3Object fullObject = null; - String key = postFix + "/" + path; - System.out.println(path); - System.out.println(bucket); - try { - fullObject = awsS3.getObject(new GetObjectRequest(bucket, key)); - System.out.println("Content-Type: " + fullObject.getObjectMetadata().getContentType()); - return fullObject.getObjectContent(); - } catch (Exception e) { - throw e; - } finally { - // To ensure that the network connection doesn't remain open, close any open input streams. - if (fullObject != null) { - try { - fullObject.close(); - } catch (Exception e) { - System.out.println("key " + key + " failed to download.\n" + e.getMessage()); - throw e; - - //return fullObject.getObjectContent(); - } - } - } - - } catch (Exception e) { + fullObject = awsS3.getObject(new GetObjectRequest(bucket, key)); + System.out.println("Content-Type: " + fullObject.getObjectMetadata().getContentType()); + return fullObject.getObjectContent(); + } catch (Exception e) { e.printStackTrace(); return null; - } + } } @Override