Skip to content

Commit

Permalink
fixing issue with path substitution
Browse files Browse the repository at this point in the history
  • Loading branch information
HenryGeorgist committed Feb 23, 2023
1 parent 43e7f45 commit c5336a7
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 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.22'
version '0.0.23'
}
6 changes: 3 additions & 3 deletions src/main/java/usace/wat/plugin/CcStoreS3.java
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public boolean HandlesDataStoreType(StoreType storeType){
}
@Override
public boolean PutObject(PutObjectInput input) {
String path = remoteRootPath + "/" + manifestId + "/" + input.getFileName() + "." + input.getFileExtension();
String path = Constants.RemoteRootPath + "/" + manifestId + "/" + input.getFileName() + "." + input.getFileExtension();
byte[] data;
switch(input.getObjectState()){
case LocalDisk:
Expand All @@ -126,7 +126,7 @@ public boolean PutObject(PutObjectInput input) {
}
@Override
public boolean PullObject(PullObjectInput input) {
String path = remoteRootPath + "/" + manifestId + "/" + input.getFileName() + "." + input.getFileExtension();
String path = Constants.RemoteRootPath + "/" + manifestId + "/" + input.getFileName() + "." + input.getFileExtension();
byte[] data;
String localPath = input.getDestRootPath() + "/" + input.getFileName() + "." + input.getFileExtension();
try {
Expand Down Expand Up @@ -155,7 +155,7 @@ private void writeInputStreamToDisk(InputStream input, String outputDestination)
}
@Override
public byte[] GetObject(GetObjectInput input) throws RemoteException {
String path = remoteRootPath + "/" + manifestId + "/" + input.getFileName() + "." + input.getFileExtension();
String path = Constants.RemoteRootPath + "/" + manifestId + "/" + input.getFileName() + "." + input.getFileExtension();
byte[] data;
try {
data = DownloadBytesFromS3(path);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/usace/wat/plugin/FileDataStoreS3.java
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public FileDataStoreS3(DataStore ds){
//error out?
System.out.print("Missing S3 Root Paramter. Cannot create the store.");
}
this.remoteRootPath = "/" + config.aws_bucket + "/" +tmpRoot;
this.remoteRootPath = config.aws_bucket ;
}
private byte[] GetObject(String path) throws RemoteException {
byte[] data;
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/usace/wat/plugin/PluginManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,17 @@ public PluginManager(){
private void substitutePathVariables() {
for (DataSource ds : _payload.getInputs()){
for(String path : ds.getPaths()){
substituteDataSourcePath(path);//is this a pointer? test
path = substituteDataSourcePath(path);//is this a pointer? test
}

}
for (DataSource ds : _payload.getOutputs()){
for(String path: ds.getPaths()){
substituteDataSourcePath(path);//is this a pointer? test
path = substituteDataSourcePath(path);//is this a pointer? test
}
}
}
private void substituteDataSourcePath(String path) {
private String substituteDataSourcePath(String path) {
Matcher m = p.matcher(path);
while(m.find()){
String result = m.group();
Expand All @@ -82,7 +82,7 @@ private void substituteDataSourcePath(String path) {
break;
}
}

return path;
}
public Payload getPayload(){
return _payload;
Expand Down

0 comments on commit c5336a7

Please sign in to comment.