-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update NIO to understand new directory stand-ins #5204
Update NIO to understand new directory stand-ins #5204
Conversation
The web interface has a "create folder" button, and that creates a file ending in '/' that is used to pretend the folder exists. The web interface maintains the illusion but of course this is still only a file, so all clients (this one included) has to play along and pretend the directory exists (or users get confused). Those fake folders used to be 0-byte, but no longer. This pull request updates our code so it just looks at the trailing slash, ignoring the size of the file. It also adds a test, and in order to write the test we had to add the ability to create files whose name ends in '/', for test purpose only.
...e-cloud-nio/src/main/java/com/google/cloud/storage/contrib/nio/OptionAllowTrailingSlash.java
Outdated
Show resolved
Hide resolved
...d-nio/src/main/java/com/google/cloud/storage/contrib/nio/CloudStorageFileSystemProvider.java
Outdated
Show resolved
Hide resolved
Codecov Report
@@ Coverage Diff @@
## master #5204 +/- ##
============================================
+ Coverage 50.42% 50.42% +<.01%
- Complexity 23796 23816 +20
============================================
Files 2251 2252 +1
Lines 226836 226841 +5
Branches 24966 24961 -5
============================================
+ Hits 114371 114380 +9
+ Misses 103858 103855 -3
+ Partials 8607 8606 -1
Continue to review full report at Codecov.
|
Please run |
@sduskis done. |
...e-cloud-nio/src/main/java/com/google/cloud/storage/contrib/nio/OptionAllowTrailingSlash.java
Outdated
Show resolved
Hide resolved
...d-nio/src/main/java/com/google/cloud/storage/contrib/nio/CloudStorageFileSystemProvider.java
Outdated
Show resolved
Hide resolved
I hope everyone had a good weekend! @chingor13 the code should be ready, let me know in case there's still a ball in my camp! |
Thank you very much! |
The web interface has a "create folder" button, and that creates
a file ending in '/' that is used to pretend the folder exists.
The web interface maintains the illusion but of course this is still only a file,
so all clients (this one included) has to play along and pretend the directory
exists (or users get confused).
Those fake folders used to be 0-byte, but no longer. This pull request
updates our code so it just looks at the trailing slash, ignoring the size
of the file.
It also adds a test, and in order to write the test we had to add the ability
to create files whose name ends in '/', for test purpose only.
Fixes #5203