Skip to content

Commit 56e9d92

Browse files
---
yaml --- r: 7847 b: refs/heads/tswast-patch-1 c: 0fb03eb h: refs/heads/master i: 7845: 65223b7 7843: 1fc6a70 7839: 1add59f
1 parent 247cf2b commit 56e9d92

4 files changed

Lines changed: 16 additions & 2 deletions

File tree

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,5 +57,5 @@ refs/tags/v0.18.0: 9d193c4c4b9d1c6f21515dd8e50836b9194ec9bb
5757
refs/tags/v0.19.0: e67b56e4d8dad5f9a7b38c9b2107c23c828f2ed5
5858
refs/tags/v0.20.0: 839f7fb7156535146aa1cb2c5aadd8d375d854e8
5959
refs/tags/v0.20.1: 370471f437f1f4f68a11e068df5cd6bf39edb1fa
60-
refs/heads/tswast-patch-1: 235874dc168f0e66c57d5ac4c3004b2b24bf82a4
60+
refs/heads/tswast-patch-1: 0fb03eb5f6cf62556518566a4b0b27dc516ee7de
6161
refs/heads/pubsub-streaming-pull: 19262b752ee874eb2ca3b950eb2aef44d5a5267b

branches/tswast-patch-1/google-cloud-contrib/google-cloud-nio/src/main/java/com/google/cloud/storage/contrib/nio/CloudStorageFileSystemProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,7 @@ public DirectoryStream<Path> newDirectoryStream(Path dir, final Filter<? super P
598598
final CloudStoragePath cloudPath = CloudStorageUtil.checkPath(dir);
599599
checkNotNull(filter);
600600
initStorage();
601-
String prefix = cloudPath.toString();
601+
String prefix = cloudPath.toRealPath().toString();
602602
final Iterator<Blob> blobIterator = storage.list(cloudPath.bucket(),
603603
Storage.BlobListOption.prefix(prefix), Storage.BlobListOption.currentDirectory(),
604604
Storage.BlobListOption.fields()).iterateAll();

branches/tswast-patch-1/google-cloud-contrib/google-cloud-nio/src/test/java/com/google/cloud/storage/contrib/nio/CloudStorageFileSystemTest.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,13 @@ public void testListFiles() throws IOException {
158158
got.add(path);
159159
}
160160
assertThat(got).containsExactlyElementsIn(goodPaths);
161+
162+
// Must also work with relative path
163+
got.clear();
164+
for (Path path : Files.newDirectoryStream(fs.getPath("dir/"))) {
165+
got.add(path);
166+
}
167+
assertThat(got).containsExactlyElementsIn(goodPaths);
161168
}
162169
}
163170

branches/tswast-patch-1/google-cloud-contrib/google-cloud-nio/src/test/java/com/google/cloud/storage/contrib/nio/it/ITGcsNio.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,13 @@ public void testListFiles() throws IOException {
347347
}
348348

349349
List<Path> got = new ArrayList<>();
350+
for (Path path : Files.newDirectoryStream(fs.getPath("/dir/"))) {
351+
got.add(path);
352+
}
353+
assertThat(got).containsExactlyElementsIn(goodPaths);
354+
355+
// Must also work with relative path
356+
got.clear();
350357
for (Path path : Files.newDirectoryStream(fs.getPath("dir/"))) {
351358
got.add(path);
352359
}

0 commit comments

Comments
 (0)