org.jets3t.service.model
Class BaseS3Object

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

public abstract class BaseS3Object
extends java.lang.Object
implements java.io.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(java.util.Map metadata)
          Adds all the items in the provided map to this object's metadata.
 void addMetadata(java.lang.String name, java.lang.Object value)
          Adds a metadata item to the object.
 boolean containsMetadata(java.lang.String name)
           
 java.lang.Object getMetadata(java.lang.String name)
           
 java.util.Map getMetadataMap()
           
 void removeMetadata(java.lang.String name)
          Removes a metadata item from the object.
 void replaceAllMetadata(java.util.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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseS3Object

public BaseS3Object()
Method Detail

getMetadataMap

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

getMetadata

public java.lang.Object getMetadata(java.lang.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(java.lang.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(java.lang.String name,
                        java.lang.Object value)
Adds a metadata item to the object.

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

addAllMetadata

public void addAllMetadata(java.util.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(java.lang.String name)
Removes a metadata item from the object.

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

replaceAllMetadata

public void replaceAllMetadata(java.util.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.