GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Update NIO to understand new directory stand-ins by jean-philippe-martin · Pull Request #5204 · googleapis/google-cloud-java

Conversation

@jean-philippe-martin

@jean-philippe-martin jean-philippe-martin commented May 20, 2019

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@jean-philippe-martin
Update NIO to understand directory stand-ins
ac326be
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 team May 20, 2019 22:50
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label May 20, 2019
@pmakani pmakani added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label May 21, 2019
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label May 21, 2019
pmakani
pmakani reviewed May 21, 2019
View reviewed changes
Comment thread ...e-cloud-nio/src/main/java/com/google/cloud/storage/contrib/nio/OptionAllowTrailingSlash.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

pmakani
pmakani reviewed May 21, 2019
View reviewed changes
Comment thread ...d-nio/src/main/java/com/google/cloud/storage/contrib/nio/CloudStorageFileSystemProvider.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

@jean-philippe-martin
formatting changes
c1fd966
@codecov

codecov Bot commented May 21, 2019 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

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 Files Coverage Δ Complexity Δ
.../storage/contrib/nio/OptionAllowTrailingSlash.java 100% <100%> (ø) 2 <2> (?)
...cloud/storage/contrib/nio/CloudStorageOptions.java 80% <100%> (+2.22%) 8 <1> (+1) ⬆️
...ge/contrib/nio/CloudStorageFileSystemProvider.java 62.76% <62.5%> (+1.02%) 73 <7> (+2) ⬆️
...le/cloud/compute/v1/ProjectGlobalSnapshotName.java 56.36% <0%> (ø) 8% <0%> (ø) ⬇️
...cloud/compute/v1/ProjectZoneInstanceGroupName.java 57.14% <0%> (ø) 8% <0%> (ø) ⬇️
...1/ProjectZoneNetworkEndpointGroupResourceName.java 57.14% <0%> (ø) 8% <0%> (ø) ⬇️
...ompute/v1/ProjectRegionSubnetworkResourceName.java 57.14% <0%> (ø) 8% <0%> (ø) ⬇️
...ud/compute/v1/ProjectGlobalSecurityPolicyName.java 56.36% <0%> (ø) 8% <0%> (ø) ⬇️
...ud/compute/v1/ProjectGlobalTargetTcpProxyName.java 56.36% <0%> (ø) 8% <0%> (ø) ⬇️
...oud/compute/v1/ProjectGlobalBackendBucketName.java 56.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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

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

sduskis commented May 22, 2019

Copy link
Copy Markdown
Contributor

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sduskis
sduskis requested a review from a team May 22, 2019 18:26
@jean-philippe-martin
formatting
d4d78f1
@jean-philippe-martin

jean-philippe-martin commented May 22, 2019

Copy link
Copy Markdown
Author

@sduskis done.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

chingor13
chingor13 requested changes May 22, 2019
View reviewed changes
Comment thread ...e-cloud-nio/src/main/java/com/google/cloud/storage/contrib/nio/OptionAllowTrailingSlash.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread ...d-nio/src/main/java/com/google/cloud/storage/contrib/nio/CloudStorageFileSystemProvider.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

@chingor13 chingor13 self-assigned this May 22, 2019
@jean-philippe-martin
Update (C) year
5615f46
@chingor13 chingor13 added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label May 23, 2019
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label May 23, 2019
@jean-philippe-martin

jean-philippe-martin commented May 28, 2019

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!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

chingor13
chingor13 approved these changes May 28, 2019
View reviewed changes
@chingor13
chingor13 merged commit 722508f into googleapis:master May 28, 2019
@jean-philippe-martin

jean-philippe-martin commented May 28, 2019

Copy link
Copy Markdown
Author

Thank you very much!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jean-philippe-martin
jean-philippe-martin deleted the jp_update_to_latest_fake_folder_convention branch May 28, 2019 18:03
@kolea2 kolea2 mentioned this pull request May 29, 2019
Release google-cloud-java v0.94.0 #5238
Merged
suztomo pushed a commit that referenced this pull request Mar 30, 2026
@jean-philippe-martin @chingor13
Update NIO to understand new directory stand-ins (#5204)
e21848f
* 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
@jean-philippe-martin @chingor13
Update NIO to understand new directory stand-ins (#5204)
39cbe54
* 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 free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@chingor13 chingor13 chingor13 approved these changes
+1 more reviewer
@pmakani pmakani pmakani left review comments
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@chingor13 chingor13

Labels

cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

New Google Cloud Storage folders not recognized by NIO

Uh oh!

There was an error while loading. Please reload this page.

6 participants

@jean-philippe-martin @sduskis @chingor13 @pmakani @googlebot @yoshi-kokoro
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.