| Constructor and Description |
|---|
GenericPayload(Payload payload)
Creates a copy of the specified payload
|
GenericPayload(java.lang.String id)
Creates an empty payload
|
GenericPayload(java.lang.String id,
java.io.File payloadFile)
Creates an file based payload
|
GenericPayload(java.lang.String id,
java.lang.String label,
java.lang.String contentType)
Creates a data payload with the specified identifier, label and content
type, but no content stream
|
GenericPayload(java.lang.String id,
java.lang.String label,
java.lang.String contentType,
PayloadType payloadType)
Creates a data payload with the specified identifier, label, content type
and payload type but no content stream
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the input stream for this payload
|
java.lang.String |
getContentType()
Gets the content (MIME) type for this payload
|
java.lang.String |
getId()
Gets the identifier for this payload
|
java.lang.String |
getLabel()
Gets the descriptive label for this payload
|
PayloadType |
getType()
Gets the type of this payload
|
boolean |
hasMetaChanged()
Status of the metadata if it has changed
|
boolean |
isLinked()
Returns whether the file is linked or stored
|
java.lang.Long |
lastModified()
Return the timestamp when the payload was last modified
|
java.io.InputStream |
open()
Gets the input stream to access the content for this payload
|
void |
setContentType(java.lang.String contentType)
Sets the content (MIME) type for this payload
|
void |
setId(java.lang.String id)
Sets the identifier for this payload
|
void |
setInputStream(java.io.InputStream in)
Sets the input stream to access the content for this payload.
|
void |
setLabel(java.lang.String label)
Sets the descriptive label for this payload
|
void |
setLinked(boolean newLinked)
Set the link state
|
void |
setMetaChanged(boolean metaChanged)
Set the metadata changed flag to a specific value.
|
void |
setType(PayloadType type)
Sets the type of this payload
|
java.lang.Long |
size()
Return the size of the payload in byte
|
java.lang.String |
toString()
Gets the Payload identifier
|
public GenericPayload(java.lang.String id)
id - an identifierpublic GenericPayload(java.lang.String id,
java.lang.String label,
java.lang.String contentType)
id - an identifierlabel - a descriptive labelcontentType - the content typepublic GenericPayload(java.lang.String id,
java.lang.String label,
java.lang.String contentType,
PayloadType payloadType)
id - an identifierlabel - a descriptive labelcontentType - the content typepayloadType - the payload typepublic GenericPayload(java.lang.String id,
java.io.File payloadFile)
id - an identifierpayloadFile - the file for the payloadpublic GenericPayload(Payload payload)
payload - payload to copypublic boolean hasMetaChanged()
true if metadata has changed, false
otherwisepublic void setMetaChanged(boolean metaChanged)
metaChanged - public java.lang.String getId()
public void setId(java.lang.String id)
public PayloadType getType()
public boolean isLinked()
public void setLinked(boolean newLinked)
newLinked - True if linked, otherwise falsepublic void setType(PayloadType type)
public java.lang.String getLabel()
public void setLabel(java.lang.String label)
public java.lang.String getContentType()
getContentType in interface Payloadpublic void setContentType(java.lang.String contentType)
setContentType in interface Payloada - String MIME typepublic java.io.InputStream open()
throws StorageException
open in interface Payloadjava.io.IOException - if there was an error reading the streamStorageExceptionpublic void close()
throws StorageException
close in interface PayloadStorageException - if there was an error closing the streampublic void setInputStream(java.io.InputStream in)
in - the content input streampublic java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.Long lastModified()
lastModified in interface PayloadCopyright © 2009-2018. All Rights Reserved.