GeezerVison is showing github.com (truncated) — Allow deletion of empty folders by jean-philippe-martin · Pull Request #1630 · googleapis/google-cloud-java
Conversation
(even though we normally don't allow operations on folders
since they are not represented). This helps with NIO-using code
that must also work with filesystems that do represent folders.
Also add a test for Files.WalkFileTree.
This should help with issue #1519
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
(even though we normally don't allow operations on folders
since they are not represented). This helps with NIO-using code
that must also work with filesystems that *do* represent folders.
|

Coverage decreased (-0.001%) to 81.123% when pulling 7602426 on jean-philippe-martin:jp_delete_empty_folder into 68ce84d on GoogleCloudPlatform:master.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|

Coverage increased (+0.007%) to 81.131% when pulling 2a218c2 on jean-philippe-martin:jp_delete_empty_folder into 68ce84d on GoogleCloudPlatform:master.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
|
}
|
|
|
}
|
|
|
|
|
|
@Test(expected = CloudStoragePseudoDirectoryException.class)
|
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
|
* @param directory the directory to delete
|
|
|
* @throws IOException
|
|
|
*/
|
|
|
static private void deleteRecursive(Path directory) throws IOException {
|
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
|
assertThat(Files.exists(fs.getPath("playwrights/French/Corneille"))).isFalse();
|
|
|
assertThat(Files.exists(fs.getPath("Racine"))).isTrue();
|
|
|
Files.deleteIfExists(fs.getPath("Racine"));
|
|
|
}
|
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
|
* @param directory the directory to delete
|
|
|
* @throws IOException
|
|
|
*/
|
|
|
static private void deleteRecursive(Path directory) throws IOException {
|
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
|
// We can't check Files.exists on a folder (since GCS fakes folders),
|
|
|
Path dir = fs.getPath("dir/");
|
|
|
Files.deleteIfExists(dir);
|
|
|
}
|
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
|
assertThat(Files.exists(fs.getPath("dir/dir3/cloud"))).isFalse();
|
|
|
assertThat(Files.exists(fs.getPath("atroot"))).isTrue();
|
|
|
}
|
|
|
}
|
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Thank you very much for taking a look! I'm pushing a new version that should address everything.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|

Changes Unknown when pulling 05b8bee on jean-philippe-martin:jp_delete_empty_folder into ** on GoogleCloudPlatform:master**.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|

Changes Unknown when pulling 6900323 on jean-philippe-martin:jp_delete_empty_folder into ** on GoogleCloudPlatform:master**.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
meltsufin
pushed a commit
that referenced
this pull request
Dec 22, 2025
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
chingor13
pushed a commit
that referenced
this pull request
Feb 24, 2026
* fix: respect token_uri from json in UserCredentials creation.
* fix format
* add comment.
suztomo
pushed a commit
to suztomo/google-cloud-java
that referenced
this pull request
Mar 11, 2026
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
chingor13
pushed a commit
that referenced
this pull request
Mar 12, 2026
* fix: respect token_uri from json in UserCredentials creation.
* fix format
* add comment.
suztomo
pushed a commit
to suztomo/google-cloud-java
that referenced
this pull request
Mar 23, 2026
suztomo
pushed a commit
that referenced
this pull request
Mar 30, 2026
(even though we normally don't allow operations on folders
since they are not represented). This helps with NIO-using code
that must also work with filesystems that *do* represent folders.
lqiu96
pushed a commit
that referenced
this pull request
Apr 1, 2026
(even though we normally don't allow operations on folders
since they are not represented). This helps with NIO-using code
that must also work with filesystems that *do* represent folders.
|