-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
Thanks for stopping by to let us know something could be better!
Please include as much information as possible:
Environment details
- google-cloud-java version(s): google-cloud-nio:0.69.0-alpha
Steps to reproduce
- In the GCS UI within a bucket, press create folder button and create a folder called
dir - Upload a file within
dircall thisfileA
Code snippet
FileSystem fs = ....
Files.walkFileTree(fs.getPath("dir") new SimpleFileVisitor<Path>() {
@Override
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
System.out.println(file);
return FileVisitResult.CONTINUE;
}Any additional information below
The GCS UI creates a 0 byte object called dir/ This causes readAttributes to return https://github.com/googleapis/google-cloud-java/blob/v0.69.0/google-cloud-clients/google-cloud-contrib/google-cloud-nio/src/main/java/com/google/cloud/storage/contrib/nio/CloudStorageFileSystemProvider.java#L765, which prevents further traversal of objects within that directory.
Does it make sense to do a check like https://github.com/googleapis/google-cloud-java/blob/v0.69.0/google-cloud-clients/google-cloud-contrib/google-cloud-nio/src/main/java/com/google/cloud/storage/contrib/nio/CloudStorageFileSystemProvider.java#L756 usePseudoDirectories is enabled and it is a 0 byte object?
I saw this related merged PR https://github.com/googleapis/google-cloud-java/pull/3775/files by @jean-philippe-martin