Skip to content

Commit

Permalink
added changes to fix issue 318 (#320)
Browse files Browse the repository at this point in the history
* added changes to fix issue 318

* removed duplicate line missed while commit

Co-authored-by: Shiv Prakash Yadav <shiv.prakash.yadav@ibm.com>
  • Loading branch information
shivprakashy and Shiv Prakash Yadav authored Dec 29, 2022
1 parent 538221b commit b006fe7
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/main/java/com/ibm/stocator/fs/cos/COSAPIClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -1502,8 +1502,15 @@ public boolean rename(String hostName, String srcPath, String dstPath) throws IO
newDstKey = newDstKey + "/";
}

String filename = newSrcKey.substring(pathToKey(src).length() + 1);
// fix start: https://github.com/CODAIT/stocator/issues/318
String filename = newSrcKey.substring(pathToKey(src).length());
newDstKey = newDstKey + filename;

if (pathToKey(src).endsWith(".inprogress")) {
newDstKey = newDstKey.substring(0, newDstKey.lastIndexOf("/"));
}
// fix end

CopyObjectRequest copyObjectRequest =
new CopyObjectRequest(mBucket, newSrcKey, mBucket, newDstKey);
ObjectMetadata srcmd = getObjectMetadata(newSrcKey);
Expand Down

0 comments on commit b006fe7

Please sign in to comment.