Package com.google.cloud.storage
Class Storage.BlobListOption
java.lang.Object
com.google.cloud.storage.Option<com.google.cloud.storage.UnifiedOpts.ObjectListOpt>
com.google.cloud.storage.Storage.BlobListOption
- All Implemented Interfaces:
Serializable
- Enclosing interface:
- Storage
public static class Storage.BlobListOption
extends Option<com.google.cloud.storage.UnifiedOpts.ObjectListOpt>
Class for specifying blob list options.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic Storage.BlobListOptionIf specified, results are returned in a directory-like mode.static Storage.BlobListOption[]dedupe(Storage.BlobListOption... os) Deduplicate any options which are the same parameter.static Storage.BlobListOption[]dedupe(Storage.BlobListOption[] array, Storage.BlobListOption... os) Deduplicate any options which are the same parameter.static Storage.BlobListOption[]dedupe(Collection<Storage.BlobListOption> collection, Storage.BlobListOption... os) Deduplicate any options which are the same parameter.static Storage.BlobListOptionReturns an option to set a delimiter.static Storage.BlobListOptionReturns an option to set a endOffset to filter results to objects whose names are lexicographically before endOffset.booleanDeprecated.static Storage.BlobListOptionextraHeaders(@NonNull com.google.common.collect.ImmutableMap<String, String> extraHeaders) A set of extra headers to be set for all requests performed within the scope of the operation this option is passed to (a get, read, resumable upload etc).static Storage.BlobListOptionfields(Storage.BlobField... fields) Returns an option to specify the blob's fields to be returned by the RPC call.inthashCode()Deprecated.static Storage.BlobListOptionincludeFolders(boolean includeFolders) Returns an option for whether to include all Folders (including empty Folders) in response.static Storage.BlobListOptionReturns an option which will cause blobs that end in exactly one instance of `delimiter` will have their metadata included rather than being synthetic objects.static Storage.BlobListOptionReturns an option to set a glob pattern to filter results to blobs that match the pattern.static Storage.BlobListOptionpageSize(long pageSize) Returns an option to specify the maximum number of blobs returned per page.static Storage.BlobListOptionReturns an option to specify the page token from which to start listing blobs.static Storage.BlobListOptionReturns an option to set a prefix to filter results to blobs whose names begin with this prefix.static Storage.BlobListOptionsoftDeleted(boolean softDeleted) Returns an option for whether the list result should include soft-deleted objects.static Storage.BlobListOptionstartOffset(@NonNull String startOffset) Returns an option to set a startOffset to filter results to objects whose names are lexicographically equal to or after startOffset.toString()Deprecated.static Storage.BlobListOptionuserProject(@NonNull String userProject) Returns an option to define the billing user project.static Storage.BlobListOptionversions(boolean versions) If set totrue, lists all versions of a blob.
-
Method Details
-
pageSize
Returns an option to specify the maximum number of blobs returned per page. -
pageToken
@TransportCompatibility({HTTP,GRPC}) public static Storage.BlobListOption pageToken(@NonNull String pageToken) Returns an option to specify the page token from which to start listing blobs. -
prefix
@TransportCompatibility({HTTP,GRPC}) public static Storage.BlobListOption prefix(@NonNull String prefix) Returns an option to set a prefix to filter results to blobs whose names begin with this prefix. -
currentDirectory
If specified, results are returned in a directory-like mode. Blobs whose names, after a possibleprefix(String), do not contain the '/' delimiter are returned as is. Blobs whose names, after a possibleprefix(String), contain the '/' delimiter, will have their name truncated after the delimiter and will be returned asBlobobjects where onlyBlobInfo.getBlobId(),BlobInfo.getSize()andBlobInfo.isDirectory()are set. For such directory blobs, (BlobId.getGeneration()returnsnull),BlobInfo.getSize()returns0whileBlobInfo.isDirectory()returnstrue. Duplicate directory blobs are omitted. -
delimiter
@TransportCompatibility({HTTP,GRPC}) public static Storage.BlobListOption delimiter(@NonNull String delimiter) Returns an option to set a delimiter.- Parameters:
delimiter- generally '/' is the one used most often, but you can used other delimiters as well.
-
startOffset
@TransportCompatibility({HTTP,GRPC}) public static Storage.BlobListOption startOffset(@NonNull String startOffset) Returns an option to set a startOffset to filter results to objects whose names are lexicographically equal to or after startOffset. If endOffset is also set, the objects listed have names between startOffset (inclusive) and endOffset (exclusive).- Parameters:
startOffset- startOffset to filter the results
-
endOffset
@TransportCompatibility({HTTP,GRPC}) public static Storage.BlobListOption endOffset(@NonNull String endOffset) Returns an option to set a endOffset to filter results to objects whose names are lexicographically before endOffset. If startOffset is also set, the objects listed have names between startOffset (inclusive) and endOffset (exclusive).- Parameters:
endOffset- endOffset to filter the results
-
matchGlob
@BetaApi @TransportCompatibility({HTTP,GRPC}) public static Storage.BlobListOption matchGlob(@NonNull String glob) Returns an option to set a glob pattern to filter results to blobs that match the pattern.- See Also:
-
includeFolders
@TransportCompatibility({HTTP,GRPC}) public static Storage.BlobListOption includeFolders(boolean includeFolders) Returns an option for whether to include all Folders (including empty Folders) in response. -
includeTrailingDelimiter
@TransportCompatibility({HTTP,GRPC}) public static Storage.BlobListOption includeTrailingDelimiter()Returns an option which will cause blobs that end in exactly one instance of `delimiter` will have their metadata included rather than being synthetic objects.- Since:
- 2.52.0
-
userProject
@TransportCompatibility({HTTP,GRPC}) public static Storage.BlobListOption userProject(@NonNull String userProject) Returns an option to define the billing user project. This option is required by buckets with `requester_pays` flag enabled to assign operation costs.- Parameters:
userProject- projectId of the billing user project.
-
versions
@TransportCompatibility({HTTP,GRPC}) public static Storage.BlobListOption versions(boolean versions) If set totrue, lists all versions of a blob. The default isfalse.- See Also:
-
fields
@TransportCompatibility({HTTP,GRPC}) public static Storage.BlobListOption fields(Storage.BlobField... fields) Returns an option to specify the blob's fields to be returned by the RPC call. If this option is not provided all blob's fields are returned.BlobListOption.fields) can be used to specify only the fields of interest. Blob name and bucket are always returned, even if not specified. -
softDeleted
@TransportCompatibility({HTTP,GRPC}) public static Storage.BlobListOption softDeleted(boolean softDeleted) Returns an option for whether the list result should include soft-deleted objects. -
extraHeaders
@TransportCompatibility({HTTP,GRPC}) public static Storage.BlobListOption extraHeaders(@NonNull com.google.common.collect.ImmutableMap<String, String> extraHeaders) A set of extra headers to be set for all requests performed within the scope of the operation this option is passed to (a get, read, resumable upload etc).If the same header name is specified across multiple options provided to a method, the first occurrence will be the value included in the request(s).
The following headers are not allowed to be specified, and will result in an
IllegalArgumentException.Accept-EncodingCache-ControlConnectionContent-IDContent-LengthContent-RangeContent-Transfer-EncodingContent-TypeDateETagIf-MatchIf-None-MatchKeep-AliveRangeTETrailerTransfer-EncodingUser-AgentX-Goog-Api-ClientX-Goog-Content-Length-RangeX-Goog-Copy-Source-Encryption-AlgorithmX-Goog-Copy-Source-Encryption-KeyX-Goog-Copy-Source-Encryption-Key-Sha256X-Goog-Encryption-AlgorithmX-Goog-Encryption-KeyX-Goog-Encryption-Key-Sha256X-Goog-Gcs-Idempotency-TokenX-Goog-Meta-*X-Goog-User-ProjectX-HTTP-Method-OverrideX-Upload-Content-LengthX-Upload-Content-Type
- Since:
- 2.49.0
-
dedupe
Deduplicate any options which are the same parameter. The value which comes last inoswill be the value included in the return. -
dedupe
public static Storage.BlobListOption[] dedupe(Collection<Storage.BlobListOption> collection, Storage.BlobListOption... os) Deduplicate any options which are the same parameter.The value which comes last in
collectionandoswill be the value included in the return. All options fromoswill override their counterparts incollection. -
dedupe
public static Storage.BlobListOption[] dedupe(Storage.BlobListOption[] array, Storage.BlobListOption... os) Deduplicate any options which are the same parameter.The value which comes last in
collectionandoswill be the value included in the return. All options fromoswill override their counterparts incollection. -
equals
Deprecated. -
hashCode
public int hashCode()Deprecated. -
toString
Deprecated.
-