| Constructor and Description |
|---|
GenericPayload(Payload payload)
Creates a copy of the specified payload
|
GenericPayload(String id)
Creates an empty payload
|
GenericPayload(String id,
File payloadFile)
Creates an file based payload
|
GenericPayload(String id,
String label,
String contentType)
Creates a data payload with the specified identifier, label and content
type, but no content stream
|
GenericPayload(String id,
String label,
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
|
String |
getContentType()
Gets the content (MIME) type for this payload
|
String |
getId()
Gets the identifier for this payload
|
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
|
Long |
lastModified()
Return the timestamp when the payload was last modified
|
InputStream |
open()
Gets the input stream to access the content for this payload
|
void |
setContentType(String contentType)
Sets the content (MIME) type for this payload
|
void |
setId(String id)
Sets the identifier for this payload
|
void |
setInputStream(InputStream in)
Sets the input stream to access the content for this payload.
|
void |
setLabel(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
|
Long |
size()
Return the size of the payload in byte
|
String |
toString()
Gets the Payload identifier
|
public GenericPayload(String id)
id - an identifierpublic GenericPayload(String id, String label, String contentType)
id - an identifierlabel - a descriptive labelcontentType - the content typepublic GenericPayload(String id, String label, String contentType, PayloadType payloadType)
id - an identifierlabel - a descriptive labelcontentType - the content typepayloadType - the payload typepublic GenericPayload(String id, 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 String getId()
public void setId(String id)
public PayloadType getType()
public boolean isLinked()
public void setLinked(boolean newLinked)
newLinked - True if linked, otherwise falsepublic void setType(PayloadType type)
public String getLabel()
public void setLabel(String label)
public String getContentType()
getContentType in interface Payloadpublic void setContentType(String contentType)
setContentType in interface Payloada - String MIME typepublic InputStream open() throws StorageException
open in interface PayloadIOException - 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(InputStream in)
in - the content input streampublic String toString()
public Long lastModified()
lastModified in interface PayloadCopyright © 2009-2013. All Rights Reserved.