Package org.jets3t.service.model
Class BaseStorageItem
java.lang.Object
org.jets3t.service.model.BaseStorageItem
- Direct Known Subclasses:
StorageBucket
,StorageObject
Base class to represent storage items that can contain metadata: both objects and buckets.
- Author:
- James Murty
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAllMetadata
(Map<String, Object> metadata) Adds all the items in the provided map to this object's metadata.void
addMetadata
(String name, String value) Adds a metadata item to the object.void
addMetadata
(String name, Date value) Adds a Date metadata item to the object.void
addMetadata
(String name, StorageOwner value) Adds an owner metadata item to the object.boolean
containsMetadata
(String name) getMetadata
(String name) getName()
getOwner()
void
removeMetadata
(String name) Removes a metadata item from the object.void
replaceAllMetadata
(Map<String, Object> metadata) Removes all the metadata items associated with this object, then adds all the items in the provided map.void
Set the name of the bucket.void
setOwner
(StorageOwner owner) Set this object's owner object based on information returned from the service.
-
Field Details
-
METADATA_HEADER_CREATION_DATE
- See Also:
-
METADATA_HEADER_LAST_MODIFIED_DATE
- See Also:
-
METADATA_HEADER_DATE
- See Also:
-
METADATA_HEADER_CONTENT_MD5
- See Also:
-
METADATA_HEADER_CONTENT_LENGTH
- See Also:
-
METADATA_HEADER_CONTENT_TYPE
- See Also:
-
METADATA_HEADER_CONTENT_ENCODING
- See Also:
-
METADATA_HEADER_CONTENT_DISPOSITION
- See Also:
-
METADATA_HEADER_CONTENT_LANGUAGE
- See Also:
-
METADATA_HEADER_ETAG
- See Also:
-
-
Method Details
-
getName
- Returns:
- the name of the bucket.
-
setName
Set the name of the bucket.- Parameters:
name
- the name for the bucket
-
getMetadataMap
- Returns:
- an immutable map containing all the metadata associated with this object.
-
getMetadata
- 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
- Parameters:
name
- the metadata item name.- Returns:
- true if this object contains a metadata item with the given name, false otherwise.
-
addMetadata
Adds a metadata item to the object.- Parameters:
name
- the metadata item name.value
- the metadata item value.
-
addMetadata
Adds a Date metadata item to the object.- Parameters:
name
- the metadata item name.value
- the metadata item's date value.
-
addMetadata
Adds an owner metadata item to the object.- Parameters:
name
- the metadata item name.value
- the metadata item's owner value.
-
addAllMetadata
Adds all the items in the provided map to this object's metadata.- Parameters:
metadata
- metadata items to add.
-
removeMetadata
Removes a metadata item from the object.- Parameters:
name
- the name of the metadata item to remove.
-
replaceAllMetadata
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.
-
getOwner
- Returns:
- this object's owner, or null if the owner is not available.
-
setOwner
Set this object's owner object based on information returned from the service. This method should only by used by code that reads service responses.- Parameters:
owner
-
-