-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
api: storageIssues related to the Cloud Storage API.Issues related to the Cloud Storage API.type: questionRequest for information or clarification. Not an issue.Request for information or clarification. Not an issue.
Description
I'm happy to see that requester-pays support was just added!
afaict, I can't set the userProject in a CloudStorageFileSystemProvider that gets instantiated via the Java NIO FileSystemProvider machinery, which uses Class.newInstance() to invoke the nullary constructor:
import java.net.URI;
import java.nio.file.Paths;
import java.nio.file.Files;
Files.newDirectoryStream(Paths.get(new URI("gs://<bucket>")))throws:
com.google.cloud.storage.StorageException: Bucket is requester pays bucket but no user project provided.
at com.google.cloud.storage.spi.v1.HttpStorageRpc.translate(HttpStorageRpc.java:220)
at com.google.cloud.storage.spi.v1.HttpStorageRpc.list(HttpStorageRpc.java:347)
at com.google.cloud.storage.StorageImpl$8.call(StorageImpl.java:299)
…
Is there a way to set the user-project, other than as a ctor param?
- an environment variable would seem easiest
- afaict there's no standard mechanism for doing that across GCS libraries in various languages
- perhaps it's still ok to add one here
- a setter would help a bit
- I'll be mainly using it from hammerlab/path-utils, where I (unfortunately) have code to reach into the
installedProvidersand modify the providers for a given URI scheme - a setter would at least save me from a second reflection hack to reach
- I'll be mainly using it from hammerlab/path-utils, where I (unfortunately) have code to reach into the
Metadata
Metadata
Assignees
Labels
api: storageIssues related to the Cloud Storage API.Issues related to the Cloud Storage API.type: questionRequest for information or clarification. Not an issue.Request for information or clarification. Not an issue.