This repository was archived by the owner on Feb 26, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +17
-2
lines changed
main/java/com/upplication/s3fs
test/java/com/upplication/s3fs/Path Expand file tree Collapse file tree 3 files changed +17
-2
lines changed Original file line number Diff line number Diff line change 44 <groupId >com.upplication</groupId >
55 <artifactId >s3fs</artifactId >
66 <packaging >jar</packaging >
7- <version >2.2.1 </version >
7+ <version >2.2.2 </version >
88 <name >s3fs</name >
99 <description >S3 filesystem provider for Java 7</description >
1010 <url >https://github.com/Upplication/Amazon-S3-FileSystem-NIO2</url >
Original file line number Diff line number Diff line change @@ -465,7 +465,7 @@ public URI toUri() {
465465 return URI .create ("s3://" + normalizeURI (builder .toString ()));
466466 }
467467 else {
468- return URI .create (this . uri );
468+ return URI .create (uri );
469469 }
470470 }
471471
Original file line number Diff line number Diff line change @@ -57,6 +57,13 @@ public void toUriWithEndSlash() {
5757 assertEquals (S3_GLOBAL_URI_TEST + "bucket/folder/" , s3Path .toUri ().toString ());
5858 }
5959
60+ @ Test
61+ public void toUriWithSpaces () {
62+ S3Path s3Path = getPath ("/bucket/with spaces" );
63+
64+ assertEquals (S3_GLOBAL_URI_TEST .resolve ("bucket/with%20spaces" ) , s3Path .toUri ());
65+ }
66+
6067 @ Test
6168 public void toUriWithNotEndSlash () {
6269 S3Path s3Path = getPath ("/bucket/file" );
@@ -72,6 +79,14 @@ public void toUriRelative() {
7279 assertEquals (URI .create ("bla" ), path .toUri ());
7380 }
7481
82+ @ Test
83+ public void toUriRelativeWithSpaces () {
84+ S3FileSystem fileSystem = s3fsProvider .getFileSystem (S3_GLOBAL_URI_TEST );
85+
86+ S3Path path = new S3Path (fileSystem , "with space" );
87+ assertEquals (URI .create ("with%20space" ), path .toUri ());
88+ }
89+
7590 @ Test
7691 public void toUriBucketWithoutEndSlash () {
7792 S3Path s3Path = getPath ("/bucket" );
You can’t perform that action at this time.
0 commit comments