Class Storage.BlobListOption (2.43.1)

public static class Storage.BlobListOption extends Option<UnifiedOpts.ObjectListOpt>

Class for specifying blob list options.

Inheritance

java.lang.Object > com.google.cloud.storage.UnifiedOpts.OptionShim > Option > Storage.BlobListOption

Static Methods

currentDirectory()

public static Storage.BlobListOption currentDirectory()

If specified, results are returned in a directory-like mode. Blobs whose names, after a possible #prefix(String), do not contain the '/' delimiter are returned as is. Blobs whose names, after a possible #prefix(String), contain the '/' delimiter, will have their name truncated after the delimiter and will be returned as Blob objects where only Blob#getBlobId(), Blob#getSize() and Blob#isDirectory() are set. For such directory blobs, (BlobId#getGeneration() returns null), Blob#getSize() returns 0 while Blob#isDirectory() returns true. Duplicate directory blobs are omitted.

Returns
Type Description
Storage.BlobListOption

dedupe(Storage.BlobListOption[] os)

public static Storage.BlobListOption[] dedupe(Storage.BlobListOption[] os)

Deduplicate any options which are the same parameter. The value which comes last in os will be the value included in the return.

Parameter
Name Description
os BlobListOption[]
Returns
Type Description
BlobListOption[]

dedupe(Storage.BlobListOption[] array, Storage.BlobListOption[] os)

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 collection and os will be the value included in the return. All options from os will override their counterparts in collection.

Parameters
Name Description
array BlobListOption[]
os BlobListOption[]
Returns
Type Description
BlobListOption[]

dedupe(Collection<Storage.BlobListOption> collection, Storage.BlobListOption[] os)

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 collection and os will be the value included in the return. All options from os will override their counterparts in collection.

Parameters
Name Description
collection Collection<BlobListOption>
os BlobListOption[]
Returns
Type Description
BlobListOption[]

delimiter(@NonNull String delimiter)

public static Storage.BlobListOption delimiter(@NonNull String delimiter)

Returns an option to set a delimiter.

Parameter
Name Description
delimiter @org.checkerframework.checker.nullness.qual.NonNull java.lang.String

generally '/' is the one used most often, but you can used other delimiters as well.

Returns
Type Description
Storage.BlobListOption

endOffset(@NonNull String endOffset)

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).

Parameter
Name Description
endOffset @org.checkerframework.checker.nullness.qual.NonNull java.lang.String

endOffset to filter the results

Returns
Type Description
Storage.BlobListOption

fields(Storage.BlobField[] fields)

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.

Parameter
Name Description
fields BlobField[]
Returns
Type Description
Storage.BlobListOption

includeFolders(boolean includeFolders)

public static Storage.BlobListOption includeFolders(boolean includeFolders)

Returns an option for whether to include all Folders (including empty Folders) in response.

Parameter
Name Description
includeFolders boolean
Returns
Type Description
Storage.BlobListOption

matchGlob(@NonNull String glob)

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: List Objects

Parameter
Name Description
glob @org.checkerframework.checker.nullness.qual.NonNull java.lang.String
Returns
Type Description
Storage.BlobListOption

pageSize(long pageSize)

public static Storage.BlobListOption pageSize(long pageSize)

Returns an option to specify the maximum number of blobs returned per page.

Parameter
Name Description
pageSize long
Returns
Type Description
Storage.BlobListOption

pageToken(@NonNull String pageToken)

public static Storage.BlobListOption pageToken(@NonNull String pageToken)

Returns an option to specify the page token from which to start listing blobs.

Parameter
Name Description
pageToken @org.checkerframework.checker.nullness.qual.NonNull java.lang.String
Returns
Type Description
Storage.BlobListOption

prefix(@NonNull String prefix)

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.

Parameter
Name Description
prefix @org.checkerframework.checker.nullness.qual.NonNull java.lang.String
Returns
Type Description
Storage.BlobListOption

softDeleted(boolean softDeleted)

public static Storage.BlobListOption softDeleted(boolean softDeleted)

Returns an option for whether the list result should include soft-deleted objects.

Parameter
Name Description
softDeleted boolean
Returns
Type Description
Storage.BlobListOption

startOffset(@NonNull String startOffset)

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).

Parameter
Name Description
startOffset @org.checkerframework.checker.nullness.qual.NonNull java.lang.String

startOffset to filter the results

Returns
Type Description
Storage.BlobListOption

userProject(@NonNull String userProject)

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.

Parameter
Name Description
userProject @org.checkerframework.checker.nullness.qual.NonNull java.lang.String

projectId of the billing user project.

Returns
Type Description
Storage.BlobListOption

versions(boolean versions)

public static Storage.BlobListOption versions(boolean versions)

If set to true, lists all versions of a blob. The default is false. See Also: Object Versioning

Parameter
Name Description
versions boolean
Returns
Type Description
Storage.BlobListOption