org.jets3t.service.model
Class BaseS3Object

java.lang.Object
  extended by org.jets3t.service.model.BaseS3Object
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
S3Bucket, S3Object

public abstract class BaseS3Object
extends Object
implements Serializable

Base class to represent both S3 objects and buckets - both these object types contain metadata.

Author:
James Murty
See Also:
Serialized Form

Constructor Summary
BaseS3Object()
           
 
Method Summary
 void addAllMetadata(Map metadata)
          Adds all the items in the provided map to this object's metadata.
 void addMetadata(String name, Date value)
          Adds a Date metadata item to the object.
 void addMetadata(String name, S3Owner value)
          Adds an S3Owner metadata item to the object.
 void addMetadata(String name, String value)
          Adds a metadata item to the object.
 boolean containsMetadata(String name)
           
 Object getMetadata(String name)
           
 Map getMetadataMap()
           
 void removeMetadata(String name)
          Removes a metadata item from the object.
 void replaceAllMetadata(Map metadata)
          Removes all the metadata items associated with this object, then adds all the items in the provided map.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseS3Object

public BaseS3Object()
Method Detail

getMetadataMap

public Map getMetadataMap()
Returns:
an immutable map containing all the metadata associated with this S3 object.

getMetadata

public Object getMetadata(String name)
Parameters:
name - the metadata item name.
Returns:
the value of the metadata with the given name, or null if no such metadata item exists.

containsMetadata

public boolean containsMetadata(String name)
Parameters:
name - the metadata item name.
Returns:
true if this object contains a metadata item with the given name, false otherwise.

addMetadata

public void addMetadata(String name,
                        String value)
Adds a metadata item to the object.

Parameters:
name - the metadata item name.
value - the metadata item value.

addMetadata

public void addMetadata(String name,
                        Date value)
Adds a Date metadata item to the object.

Parameters:
name - the metadata item name.
value - the metadata item's date value.

addMetadata

public void addMetadata(String name,
                        S3Owner value)
Adds an S3Owner metadata item to the object.

Parameters:
name - the metadata item name.
value - the metadata item's owner value.

addAllMetadata

public void addAllMetadata(Map metadata)
Adds all the items in the provided map to this object's metadata.

Parameters:
metadata - metadata items to add.

removeMetadata

public void removeMetadata(String name)
Removes a metadata item from the object.

Parameters:
name - the name of the metadata item to remove.

replaceAllMetadata

public void replaceAllMetadata(Map metadata)
Removes all the metadata items associated with this object, then adds all the items in the provided map. After performing this operation, the metadata list will contain only those items in the provided map.

Parameters:
metadata - metadata items to add.