@AlfrescoPublicApi public class ContentData extends Object implements Serializable
Modifier | Constructor and Description |
---|---|
protected |
ContentData(ContentData original)
Copy constructor for derived class
|
|
ContentData(String contentUrl,
String mimetype,
long size,
String encoding)
Create a content data using the
default locale . |
|
ContentData(String contentUrl,
String mimetype,
long size,
String encoding,
Locale locale)
Create a compound set of data representing a single instance of content.
|
Modifier and Type | Method and Description |
---|---|
static ContentData |
createContentProperty(String contentPropertyStr)
Construct a content property from a string
|
boolean |
equals(Object obj) |
String |
getContentUrl() |
String |
getEncoding()
Gets the content's encoding.
|
String |
getInfoUrl() |
Locale |
getLocale()
Get the content's locale.
|
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,
String encoding)
Constructs a new instance using the existing one as a template, but replacing the
encoding.
|
static ContentData |
setMimetype(ContentData existing,
String mimetype)
Constructs a new instance using the existing one as a template, but replacing the
mimetype
|
String |
toString() |
protected ContentData(ContentData original)
original
- the object to copypublic ContentData(String contentUrl, String mimetype, long size, String encoding)
default locale
.public ContentData(String contentUrl, String mimetype, long size, String encoding, 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(String contentPropertyStr)
contentPropertyStr
- the string representing the content detailspublic static ContentData setMimetype(ContentData existing, String mimetype)
existing
- an existing set of content data, null to use default valuesmimetype
- the mimetype to setpublic static ContentData setEncoding(ContentData existing, String encoding)
existing
- an existing set of content data, null to use default valuesencoding
- the encoding to setpublic static boolean hasContent(ContentData contentData)
This method only cares if there is a binary (content URL) and makes no assumptions about the length of the binary.
contentData
- the content to check (may be null)public String toString()
public String getInfoUrl()
contentUrl=xxx|mimetype=xxx|size=xxx|encoding=xxx|locale=xxx
public String getContentUrl()
ContentIOException
public String getMimetype()
public long getSize()
public String getEncoding()
public Locale getLocale()
Copyright © 2005–2020 Alfresco Software. All rights reserved.