-
Notifications
You must be signed in to change notification settings - Fork 34
Closed
Labels
api: storageIssues related to the googleapis/java-storage-nio API.Issues related to the googleapis/java-storage-nio API.priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Description
Environment details
- FakeStorageRpc
- OS type and version: Win 10
- Java version: java 8
- google-cloud-nio version(s): 0.121.2
Steps to reproduce
- Add object with name "test-object" to bucket "first-bucket",
- Add object with name "test-object" to bucket "second-bucket".
- List objects in "first-bucket" with "test-" prefix.
- Both "test-object" files from "first-bucket" and "second-bucket" are returned.
Any additional information below
The list method in the FakeStorageRpc does not take into account the bucket metadata:
for (StorageObject so : metadata.values()) {
if (!so.getName().startsWith(prefix)) { // <---------- here's the problem
continue;
}
if (processedAsFolder(so, delimiter, prefix, folders)) {
continue;
}
so.setSize(size(so));
values.add(so);
}Technically, just adding an extra check to compare the so.getBucket() with bucket should be enough to resolve the issue.
Metadata
Metadata
Assignees
Labels
api: storageIssues related to the googleapis/java-storage-nio API.Issues related to the googleapis/java-storage-nio API.priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.