Skip to content

Commit

Permalink
fixing issue with filestores3
Browse files Browse the repository at this point in the history
  • Loading branch information
HenryGeorgist committed Feb 23, 2023
1 parent a4606d1 commit a90e618
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@ publishing {
}

group 'mil.army.usace.hec'
version '0.0.27'
version '0.0.28'
}
12 changes: 7 additions & 5 deletions src/main/java/usace/wat/plugin/FileDataStoreS3.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@


public class FileDataStoreS3 implements FileDataStore {
String remoteRootPath;
String bucket;
String postFix;
StoreType storeType;
AmazonS3 awsS3;
AWSConfig config;
Expand Down Expand Up @@ -135,7 +136,8 @@ public FileDataStoreS3(DataStore ds){
//error out?
System.out.print("Missing S3 Root Paramter. Cannot create the store.");
}
this.remoteRootPath = config.aws_bucket ;
this.bucket = config.aws_bucket;
this.postFix = tmpRoot;
}
private byte[] GetObject(String path) throws RemoteException {
byte[] data;
Expand All @@ -148,10 +150,10 @@ private byte[] GetObject(String path) throws RemoteException {
}
private byte[] DownloadBytesFromS3(String key) throws Exception{
S3Object fullObject = null;
System.out.println(key);
System.out.println(remoteRootPath);
System.out.println(postFix + "/" + key);
System.out.println(bucket);
try {
fullObject = awsS3.getObject(new GetObjectRequest(remoteRootPath, key));
fullObject = awsS3.getObject(new GetObjectRequest(bucket, key));
System.out.println("Content-Type: " + fullObject.getObjectMetadata().getContentType());
return fullObject.getObjectContent().readAllBytes();
} catch (Exception e) {
Expand Down

0 comments on commit a90e618

Please sign in to comment.