Skip to content

Commit c6e43f9

Browse files
1 parent a197a93 commit c6e43f9

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

src/main/java/software/amazon/nio/spi/s3/S3Path.java

-4
Original file line numberDiff line numberDiff line change
@@ -257,10 +257,6 @@ public S3Path subpath(int beginIndex, int endIndex) {
257257
}
258258

259259
var path = String.join(PATH_SEPARATOR, pathRepresentation.elements().subList(beginIndex, endIndex));
260-
if (this.isAbsolute() && beginIndex == 0) {
261-
path = PATH_SEPARATOR + path;
262-
}
263-
264260
if (endIndex == size && !pathRepresentation.hasTrailingSeparator()) {
265261
return from(path);
266262
} else {

src/test/java/software/amazon/nio/spi/s3/S3PathTest.java

+2
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,8 @@ public void relativize() {
336336
var bcd = fileSystem.getPath("b/c/d/");
337337
var bcdObject = fileSystem.getPath("b/c/d/object");
338338

339+
assertFalse(root.relativize(ab).isAbsolute());
340+
339341
assertEquals(fileSystem.getPath(""), absoluteObject.relativize(absoluteObject));
340342
assertEquals(fileSystem.getPath("../.."), abcd.relativize(ab));
341343
assertEquals(fileSystem.getPath("e/"), abcd.relativize(abcde));

0 commit comments

Comments
 (0)