public class Bucket extends Object
Internally a bucket is just a directory within the base directory.
| Constructor and Description |
|---|
Bucket(File file)
Creates a new bucket based on the given directory.
|
| Modifier and Type | Method and Description |
|---|---|
void |
create()
Creates the bucket.
|
void |
delete()
Deletes the bucket and all of its contents.
|
boolean |
exists()
Determines if the bucket exists.
|
File |
getFile()
Returns the underlying directory as File.
|
String |
getName()
Returns the name of the bucket.
|
StoredObject |
getObject(String id)
Returns the child object with the given id.
|
List<StoredObject> |
getObjects()
Returns a list of all stored objects
|
boolean |
isPrivate()
Determines if the bucket is private or public accessible
|
void |
makePrivate()
Marks the bucket as private accessible.
|
void |
makePublic()
Marks the bucket as public accessible.
|
void |
outputObjects(XMLStructuredOutput output,
int limit,
String marker,
String prefix)
Returns a list of at most the provided number of stored objects
|
public Bucket(File file)
file - the directory which stores the contents of the bucket.public String getName()
public void delete()
public void create()
If the underlying directory already exists, nothing happens.
public List<StoredObject> getObjects()
public void outputObjects(XMLStructuredOutput output, int limit, @Nullable String marker, @Nullable String prefix)
output - the xml structured output the list of objects should be written tolimit - controls the maximum number of objects returnedmarker - the key to start with when listing objects in a bucketprefix - limits the response to keys that begin with the specified prefixpublic boolean isPrivate()
public void makePrivate()
public void makePublic()
public File getFile()
public boolean exists()
public StoredObject getObject(String id)
id - the name of the requested child object. Must not contain .. / or \Copyright © 2016. All rights reserved.