public class ContentData
extends java.lang.Object
implements java.io.Serializable
| Modifier | Constructor and Description |
|---|---|
protected |
ContentData(ContentData original)
Copy constructor for derived class
|
|
ContentData(java.lang.String contentUrl,
java.lang.String mimetype,
long size,
java.lang.String encoding)
Create a content data using the
default locale. |
|
ContentData(java.lang.String contentUrl,
java.lang.String mimetype,
long size,
java.lang.String encoding,
java.util.Locale locale)
Create a compound set of data representing a single instance of content.
|
| Modifier and Type | Method and Description |
|---|---|
static ContentData |
createContentProperty(java.lang.String contentPropertyStr)
Construct a content property from a string
|
boolean |
equals(java.lang.Object obj) |
java.lang.String |
getContentUrl() |
java.lang.String |
getEncoding()
Gets the content's encoding.
|
java.lang.String |
getInfoUrl() |
java.util.Locale |
getLocale()
Get the content's locale.
|
java.lang.String |
getMimetype()
Gets content's mimetype.
|
long |
getSize()
Get the content's size
|
static boolean |
hasContent(ContentData contentData)
Helper method to determine if the data represents any physical content or not.
|
int |
hashCode() |
static ContentData |
setEncoding(ContentData existing,
java.lang.String encoding)
Constructs a new instance using the existing one as a template, but replacing the
encoding.
|
static ContentData |
setMimetype(ContentData existing,
java.lang.String mimetype)
Constructs a new instance using the existing one as a template, but replacing the
mimetype
|
java.lang.String |
toString() |
protected ContentData(ContentData original)
original - the object to copypublic ContentData(java.lang.String contentUrl,
java.lang.String mimetype,
long size,
java.lang.String encoding)
default locale.public ContentData(java.lang.String contentUrl,
java.lang.String mimetype,
long size,
java.lang.String encoding,
java.util.Locale locale)
In order to ensure data integrity, the mimetype
must be set if the content URL is set.
contentUrl - the content URL. If this value is non-null, then the
mimetype must be supplied.mimetype - the content mimetype. This is mandatory if the contentUrl is specified.size - the content size.encoding - the content encoding. This is mandatory if the contentUrl is specified.locale - the locale of the content (may be null). If null, the
default locale will be used.public static ContentData createContentProperty(java.lang.String contentPropertyStr)
contentPropertyStr - the string representing the content detailspublic static ContentData setMimetype(ContentData existing, java.lang.String mimetype)
existing - an existing set of content data, null to use default valuesmimetype - the mimetype to setpublic static ContentData setEncoding(ContentData existing, java.lang.String encoding)
existing - an existing set of content data, null to use default valuesencoding - the encoding to setpublic static boolean hasContent(ContentData contentData)
contentData - the content to check (may be null)public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.ObjectcontentUrl=xxx|mimetype=xxx|size=xxx|encoding=xxx|locale=xxxpublic java.lang.String getInfoUrl()
contentUrl=xxx|mimetype=xxx|size=xxx|encoding=xxx|locale=xxxpublic java.lang.String getContentUrl()
ContentIOExceptionpublic java.lang.String getMimetype()
public long getSize()
public java.lang.String getEncoding()
public java.util.Locale getLocale()
public int hashCode()
hashCode in class java.lang.ObjectCopyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.