Skip to content

Commit f322382

Browse files
jean-philippe-martinmziccard
authored andcommitted
File system close declares it throws IOException (#1060)
1 parent e7ca841 commit f322382

3 files changed

Lines changed: 52 additions & 50 deletions

File tree

gcloud-java-contrib/gcloud-java-nio/src/main/java/com/google/cloud/storage/contrib/nio/CloudStorageFileSystem.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,10 +145,12 @@ public CloudStoragePath getPath(String first, String... more) {
145145
* Does nothing.
146146
*/
147147
@Override
148-
public void close() {}
148+
public void close() throws IOException {
149+
// TODO(#809): Synchronously close all channels associated with this FileSystem instance.
150+
}
149151

150152
/**
151-
* Returns {@code true}.
153+
* Returns {@code true}, even if you previously called the {@link #close()} method.
152154
*/
153155
@Override
154156
public boolean isOpen() {

gcloud-java-contrib/gcloud-java-nio/src/test/java/com/google/cloud/storage/contrib/nio/CloudStorageFileSystemProviderTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ public void testExists_trailingSlash() {
391391
}
392392

393393
@Test
394-
public void testExists_trailingSlash_disablePseudoDirectories() {
394+
public void testExists_trailingSlash_disablePseudoDirectories() throws IOException {
395395
try (CloudStorageFileSystem fs = forBucket("military", usePseudoDirectories(false))) {
396396
assertThat(Files.exists(fs.getPath("fashion/"))).isFalse();
397397
}
@@ -547,7 +547,7 @@ public void testIsDirectory_trailingSlash_alwaysTrue() {
547547
}
548548

549549
@Test
550-
public void testIsDirectory_trailingSlash_pseudoDirectoriesDisabled_false() {
550+
public void testIsDirectory_trailingSlash_pseudoDirectoriesDisabled_false() throws IOException {
551551
try (CloudStorageFileSystem fs = forBucket("doodle", usePseudoDirectories(false))) {
552552
assertThat(Files.isDirectory(fs.getPath("fundir/"))).isFalse();
553553
}

0 commit comments

Comments
 (0)