GCS NIO readAttributes returns CloudStorageObjectAttributes for directory like objects #3918
Labels
priority: p2
Moderately-important priority. Fix may not be included in next release.
type: bug
Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Thanks for stopping by to let us know something could be better!
Please include as much information as possible:
Environment details
Steps to reproduce
dir
dir
call thisfileA
Code snippet
Any additional information below
The GCS UI creates a 0 byte object called
dir/
This causesreadAttributes
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
The text was updated successfully, but these errors were encountered: