|
Nested classes/interfaces inherited from class org.alfresco.repo.content.AbstractContentAccessor |
AbstractContentAccessor.CallbackFileChannel, AbstractContentAccessor.ChannelCloseCallbackAdvise |
Constructor Summary | ||
protected |
AbstractContentReader(String contentUrl) |
Method Summary | ||
void |
addListener(ContentStreamListener listener) Adds the listener after checking that the output stream isn't already in use. |
|
static boolean |
compareContentReaders(ContentReader left, ContentReader right) Does a comparison of the binaries associated with two readers. |
|
protected abstract ContentReader |
createReader() A factory method for subclasses to implement that will ensure the proper implementation of the ContentReader.getReader() method. |
|
void |
getContent(File file) Gets content from the repository direct to file |
|
void |
getContent(OutputStream os) Copies the input stream to the given OutputStream |
|
getContentInputStream() Get a stream to read from the underlying channel |
||
getContentString() Makes use of the encoding, if available, to convert bytes to a string. |
||
getContentString(int length) Gets content from the repository direct to String , but limiting the string size to a given number of characters. |
||
protected abstract ReadableByteChannel |
getDirectReadableChannel() Provides low-level access to read content from the repository. |
|
getFileChannel() Provides read-only, random-access to the underlying content. |
||
getLimits() | ||
getReadableChannel() Provides low-level access to the underlying content. |
||
getReader() Performs checks and copies required reader attributes |
||
getTransformerDebug() | ||
boolean |
getUseBufferedInputStream() | |
boolean |
isChannelOpen() Gets the open/close state of the underlying IO Channel. |
|
boolean |
isClosed() An automatically created listener sets the flag |
|
void |
setLimits(TransformationOptionLimits limits) | |
void |
setTransformerDebug(TransformerDebug transformerDebug) | |
void |
setUseBufferedInputStream(boolean useBufferedInputStream) |
Methods inherited from class org.alfresco.repo.content.AbstractContentAccessor |
channelOpened, finalize, getCallbackFileChannel, getContentData, getContentUrl, getEncoding, getLocale, getMimetype, setContentUrl, setEncoding, setLocale, setMimetype, toString |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.alfresco.service.cmr.repository.ContentAccessor |
getSize |
Methods inherited from interface org.alfresco.service.cmr.repository.ContentReader |
exists, getLastModified |
Only the instance need be constructed. The required mimetype, encoding, etc will be copied across by this class.
This is the only of the content reading methods that needs to be implemented by derived classes. All other content access methods make use of this in their underlying implementations.
Once the stream is provided to a client it should remain active (subject to any timeouts) until closed by the client.
OutputStream
All resources will be closed automatically.
String
, but limiting
the string size to a given number of characters.
If the encoding is known then it will be used otherwise the default system byte[] to String conversion will be used.
All resources will be closed automatically.
All the content is streamed into memory. So, like the interface said, be careful with this method.
|