@AlfrescoPublicApi
public interface ContentAccessor
Modifier and Type | Method and Description |
---|---|
void |
addListener(ContentStreamListener listener)
Use this method to register any interest in events against underlying
content streams.
|
ContentData |
getContentData()
Get the data representation of the content being accessed.
|
String |
getContentUrl()
Retrieve the URL that this accessor references
|
String |
getEncoding()
Get the encoding of the content being accessed
|
Locale |
getLocale()
Get the locale of the content being accessed
|
String |
getMimetype()
Get the content mimetype
|
long |
getSize()
Gets the size of the content that this reader references.
|
boolean |
isChannelOpen()
Gets the open/close state of the underlying IO Channel.
|
void |
setEncoding(String encoding)
Set the
String encoding for this accessor |
void |
setLocale(Locale locale)
Set the
Locale for this accessor |
void |
setMimetype(String mimetype)
Set the mimetype that must be used for accessing the content.
|
boolean isChannelOpen()
void addListener(ContentStreamListener listener)
This method can only be used before the content stream has been retrieved.
When the stream has been closed, all listeners will be called. The listener is responsible for using a retrying transaction to protect the implementation of the callback when required.
listener
- a listener that will be called for output stream
event notificationlong getSize()
OL
if the
content doesn't exist.ContentData getContentData()
The content mimetype
must be set before this
method is called as the content data requires a mimetype whenever the
content URL is specified.
ContentData.ContentData(String, String, long, String)
String getContentUrl()
String getMimetype()
void setMimetype(String mimetype)
When dealing with a ContentWriter
, you may wish
to use ContentWriter.guessMimetype(String)
to have
this set for you based on the filename and contents.
mimetype
- the content mimetypeString getEncoding()
void setEncoding(String encoding)
String
encoding for this accessor
When dealing with a ContentWriter
, you may wish
to use ContentWriter.guessMimetype(String)
to have
this set for you based on the contents.
encoding
- a java-recognised encoding formatLocale getLocale()
void setLocale(Locale locale)
Locale
for this accessorlocale
- a java-recognised localeCopyright © 2005–2019 Alfresco Software. All rights reserved.