Skip to content

Commit caefa34

Browse files
---
yaml --- r: 5399 b: refs/heads/master c: 0fb03eb h: refs/heads/master i: 5397: f112231 5395: bc3e095 5391: 0ec83a6
1 parent 27056ff commit caefa34

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
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 235874dc168f0e66c57d5ac4c3004b2b24bf82a4
2+
refs/heads/master: 0fb03eb5f6cf62556518566a4b0b27dc516ee7de
33
refs/heads/travis: dae77e558b884bc1b165155482d76c8e40b0fca4
44
refs/heads/gh-pages: 229631582f8957646f81e92ae5a326504f48ee5b
55
refs/tags/0.0.9: 22f1839238f66c39e67ed4dfdcd273b1ae2e8444

trunk/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();

trunk/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

trunk/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)