Class Storage.BlobListOption (2.22.2)

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
TypeDescription
Storage.BlobListOption

delimiter(@NonNull String delimiter)

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

Returns an option to set a delimiter.

Parameter
NameDescription
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
TypeDescription
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
NameDescription
endOffset@org.checkerframework.checker.nullness.qual.NonNull java.lang.String

endOffset to filter the results

Returns
TypeDescription
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
NameDescription
fieldsBlobField[]
Returns
TypeDescription
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
NameDescription
glob@org.checkerframework.checker.nullness.qual.NonNull java.lang.String
Returns
TypeDescription
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
NameDescription
pageSizelong
Returns
TypeDescription
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
NameDescription
pageToken@org.checkerframework.checker.nullness.qual.NonNull java.lang.String
Returns
TypeDescription
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
NameDescription
prefix@org.checkerframework.checker.nullness.qual.NonNull java.lang.String
Returns
TypeDescription
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
NameDescription
startOffset@org.checkerframework.checker.nullness.qual.NonNull java.lang.String

startOffset to filter the results

Returns
TypeDescription
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
NameDescription
userProject@org.checkerframework.checker.nullness.qual.NonNull java.lang.String

projectId of the billing user project.

Returns
TypeDescription
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
NameDescription
versionsboolean
Returns
TypeDescription
Storage.BlobListOption