Class Storage.BlobListOption (2.9.2)

public static class Storage.BlobListOption extends Option

Class for specifying blob list options.

Inheritance

Object > 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(String delimiter)

public static Storage.BlobListOption delimiter(String delimiter)

Returns an option to set a delimiter.

Parameter
NameDescription
delimiterString

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

Returns
TypeDescription
Storage.BlobListOption

endOffset(String endOffset)

public static Storage.BlobListOption endOffset(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
endOffsetString

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

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(String pageToken)

public static Storage.BlobListOption pageToken(String pageToken)

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

Parameter
NameDescription
pageTokenString
Returns
TypeDescription
Storage.BlobListOption

prefix(String prefix)

public static Storage.BlobListOption prefix(String prefix)

Returns an option to set a prefix to filter results to blobs whose names begin with this prefix.

Parameter
NameDescription
prefixString
Returns
TypeDescription
Storage.BlobListOption

startOffset(String startOffset)

public static Storage.BlobListOption startOffset(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
startOffsetString

startOffset to filter the results

Returns
TypeDescription
Storage.BlobListOption

userProject(String userProject)

public static Storage.BlobListOption userProject(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
userProjectString

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