public static class Storage.BlobListOption extends Option
Class for specifying blob list options.
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
delimiter(String delimiter)
public static Storage.BlobListOption delimiter(String delimiter)
Returns an option to set a delimiter.
Parameter
Name |
Description |
delimiter |
String
generally '/' is the one used most often, but you can used other delimiters
as well.
|
Returns
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
Name |
Description |
endOffset |
String
endOffset to filter the results
|
Returns
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
Returns
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
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
Name |
Description |
pageToken |
String
|
Returns
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
Name |
Description |
prefix |
String
|
Returns
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
Name |
Description |
startOffset |
String
startOffset to filter the results
|
Returns
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
Name |
Description |
userProject |
String
projectId of the billing user project.
|
Returns
versions(boolean versions)
public static Storage.BlobListOption versions(boolean versions)
If set to true
, lists all versions of a blob. The default is false
.
Parameter
Returns