public static class Storage.SignUrlOption extends Object implements Serializable
Modifier and Type | Method and Description |
---|---|
static Storage.SignUrlOption |
httpMethod(HttpMethod httpMethod)
The HTTP method to be used with the signed URL.
|
static Storage.SignUrlOption |
signWith(com.google.auth.ServiceAccountSigner signer)
Provides a service account signer to sign the URL.
|
static Storage.SignUrlOption |
withBucketBoundHostname(String bucketBoundHostname)
Use a bucket-bound hostname, which replaces the storage.googleapis.com host with the name of
a CNAME bucket, e.g.
|
static Storage.SignUrlOption |
withBucketBoundHostname(String bucketBoundHostname,
Storage.UriScheme uriScheme)
Use a bucket-bound hostname, which replaces the storage.googleapis.com host with the name of
a CNAME bucket, e.g.
|
static Storage.SignUrlOption |
withContentType()
Use it if signature should include the blob's content-type.
|
static Storage.SignUrlOption |
withExtHeaders(Map<String,String> extHeaders)
Use it if signature should include the blob's canonicalized extended headers.
|
static Storage.SignUrlOption |
withHostName(String hostName)
Use a different host name than the default host name 'storage.googleapis.com'.
|
static Storage.SignUrlOption |
withMd5()
Use it if signature should include the blob's md5.
|
static Storage.SignUrlOption |
withPathStyle()
Generates a path-style URL, which places the bucket name in the path portion of the URL
instead of in the hostname, e.g 'https://storage.googleapis.com/mybucket/...'.
|
static Storage.SignUrlOption |
withQueryParams(Map<String,String> queryParams)
Use if the URL should contain additional query parameters.
|
static Storage.SignUrlOption |
withV2Signature()
Use if signature version should be V2.
|
static Storage.SignUrlOption |
withV4Signature()
Use if signature version should be V4.
|
static Storage.SignUrlOption |
withVirtualHostedStyle()
Use a virtual hosted-style hostname, which adds the bucket into the host portion of the URI
rather than the path, e.g.
|
@TransportCompatibility(value=HTTP) public static Storage.SignUrlOption httpMethod(HttpMethod httpMethod)
@TransportCompatibility(value=HTTP) public static Storage.SignUrlOption withContentType()
@TransportCompatibility(value=HTTP) public static Storage.SignUrlOption withMd5()
@TransportCompatibility(value=HTTP) public static Storage.SignUrlOption withExtHeaders(Map<String,String> extHeaders)
@TransportCompatibility(value=HTTP) public static Storage.SignUrlOption withV2Signature()
withV4Signature()
is called.@TransportCompatibility(value=HTTP) public static Storage.SignUrlOption withV4Signature()
withV2Signature()
is
called.@TransportCompatibility(value=HTTP) public static Storage.SignUrlOption signWith(com.google.auth.ServiceAccountSigner signer)
@TransportCompatibility(value=HTTP) public static Storage.SignUrlOption withHostName(String hostName)
withVirtualHostedStyle()
method, you should omit the bucket name from the hostname, as it
automatically gets prepended to the hostname for virtual hosted-style URLs.@TransportCompatibility(value=HTTP) public static Storage.SignUrlOption withVirtualHostedStyle()
withExtHeaders()
method.@TransportCompatibility(value=HTTP) public static Storage.SignUrlOption withPathStyle()
withVirtualHostedStyle()
. Virtual hosted-style URLs, which can be used
via the withVirtualHostedStyle()
method, should generally be preferred instead of
path-style URLs.@TransportCompatibility(value=HTTP) public static Storage.SignUrlOption withBucketBoundHostname(String bucketBoundHostname)
withVirtualHostedStyle()
or withPathStyle()
. This method
signature uses HTTP for the URI scheme, and is equivalent to calling withBucketBoundHostname("...", UriScheme.HTTP).
@TransportCompatibility(value=HTTP) public static Storage.SignUrlOption withBucketBoundHostname(String bucketBoundHostname, Storage.UriScheme uriScheme)
withVirtualHostedStyle()
or withPathStyle()
. The
bucket name itself should not include the URI scheme (http or https), so it is specified via
a local enum.@TransportCompatibility(value=HTTP) public static Storage.SignUrlOption withQueryParams(Map<String,String> queryParams)
Warning: For V2 Signed URLs, it is possible for query parameters to be altered after the URL has been signed, as the parameters are not used to compute the signature. The V4 signing method should be preferred when supplying additional query parameters, as the parameters cannot be added, removed, or otherwise altered after a V4 signature is generated.
Copyright © 2023 Google LLC. All rights reserved.