public interface Storage extends ContentProducer, Disposable
This interface is not intended to be implemented by clients.
StorageManager.getStorage(String)
Modifier and Type | Method and Description |
---|---|
String |
getId()
Returns the identifier of the storage.
|
PropertySet |
getProperties()
Returns the properties associated with the storage.
|
void |
setContents(InputStream input,
Map<?,?> options)
Updates the underlying content of the storage.
|
void |
setContents(Part part)
Updates the underlying content of the storage.
|
getContents
dispose
String getId()
StorageManager.getStorage(String)
PropertySet getProperties()
setContents()
method.setContents(InputStream, Map)
void setContents(InputStream input, Map<?,?> options) throws IOException, UnsupportedOperationException
Properties are associated to the uploaded content. This can be header names as described in the HTTP protocol: "Content-Type"
",
"Content-Encoding"
" and "Content-Disposition"
".
The options might also contain a "Content-Expiration"
" property, which describes the number of seconds after which the storage is
considered expired If this property is set, it applies to this storage only and overrides the general storage expiration options.
This is an optional operation. The underlying storage content might not be modifiable, in which case an
UnsupportedOperationException
is thrown.
input
- the input where to read bytes to transfer to the underlying storage.options
- properties describing the uploaded content.IOException
- if the content cannot be retrieved.UnsupportedOperationException
- if the underlying content is not modifiable.Options.OPTION_STORAGE_EXPIRATION
void setContents(Part part) throws IOException, MessagingException, UnsupportedOperationException
This is an optional operation. The underlying storage content might not be modifiable, in which case an
UnsupportedOperationException
is thrown.
part
- the new content to upload in this storage.IOException
- if the content cannot be retrieved.MessagingException
- if the content cannot be retrieved.UnsupportedOperationException
- if the underlying content is not modifiable.