Skip to content

Update NIO to understand new directory stand-ins - #5204

Merged
chingor13 merged 4 commits into
googleapis:masterfrom
jean-philippe-martin:jp_update_to_latest_fake_folder_convention
May 28, 2019
Merged

Update NIO to understand new directory stand-ins#5204
chingor13 merged 4 commits into
googleapis:masterfrom
jean-philippe-martin:jp_update_to_latest_fake_folder_convention

Conversation

@jean-philippe-martin

Copy link
Copy Markdown

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

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.
@jean-philippe-martin
jean-philippe-martin requested a review from a teamMay 20, 2019 22:50
@googlebotgooglebot added the cla: yes This human has signed the Contributor License Agreement. label May 20, 2019
@pmakanipmakani added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label May 21, 2019
@yoshi-kokoroyoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label May 21, 2019
@codecov

codecovBot commented May 21, 2019

Copy link
Copy Markdown

Codecov Report

Merging #5204 into master will increase coverage by <.01%.
The diff coverage is 75%.

Impacted file tree graph

@@ 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
Impacted FilesCoverage ΔComplexity Δ
.../storage/contrib/nio/OptionAllowTrailingSlash.java100% <100%> (ø)2 <2> (?)
...cloud/storage/contrib/nio/CloudStorageOptions.java80% <100%> (+2.22%)8 <1> (+1)⬆️
...ge/contrib/nio/CloudStorageFileSystemProvider.java62.76% <62.5%> (+1.02%)73 <7> (+2)⬆️
...le/cloud/compute/v1/ProjectGlobalSnapshotName.java56.36% <0%> (ø)8% <0%> (ø)⬇️
...cloud/compute/v1/ProjectZoneInstanceGroupName.java57.14% <0%> (ø)8% <0%> (ø)⬇️
...1/ProjectZoneNetworkEndpointGroupResourceName.java57.14% <0%> (ø)8% <0%> (ø)⬇️
...ompute/v1/ProjectRegionSubnetworkResourceName.java57.14% <0%> (ø)8% <0%> (ø)⬇️
...ud/compute/v1/ProjectGlobalSecurityPolicyName.java56.36% <0%> (ø)8% <0%> (ø)⬇️
...ud/compute/v1/ProjectGlobalTargetTcpProxyName.java56.36% <0%> (ø)8% <0%> (ø)⬇️
...oud/compute/v1/ProjectGlobalBackendBucketName.java56.36% <0%> (ø)8% <0%> (ø)⬇️
... and 72 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 575eca4...5615f46. Read the comment docs.

@pmakanipmakani added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label May 22, 2019
@yoshi-kokoroyoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label May 22, 2019
@sduskis

Copy link
Copy Markdown
Contributor

Please run mvn com.coveo:fmt-maven-plugin:format to fix the code formatting issues.

@sduskis
sduskis requested a review from a teamMay 22, 2019 18:26
@jean-philippe-martin

Copy link
Copy Markdown
Author

@sduskis done.

@chingor13chingor13 self-assigned this May 22, 2019
@chingor13chingor13 added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label May 23, 2019
@yoshi-kokoroyoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label May 23, 2019
@jean-philippe-martin

Copy link
Copy Markdown
Author

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!

@chingor13
chingor13 merged commit 722508f into googleapis:masterMay 28, 2019
@jean-philippe-martin

Copy link
Copy Markdown
Author

Thank you very much!

@jean-philippe-martin
jean-philippe-martin deleted the jp_update_to_latest_fake_folder_convention branch May 28, 2019 18:03
suztomo pushed a commit that referenced this pull request Mar 30, 2026
* Update NIO to understand directory stand-ins
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.
* formatting changes
* formatting
* Update (C) year
lqiu96 pushed a commit that referenced this pull request Apr 1, 2026
* Update NIO to understand directory stand-ins
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.
* formatting changes
* formatting
* Update (C) year
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yesThis human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

New Google Cloud Storage folders not recognized by NIO

6 participants

@jean-philippe-martin@sduskis@chingor13@pmakani@googlebot@yoshi-kokoro