|
Nested classes/interfaces inherited from class org.alfresco.repo.content.AbstractContentAccessor |
AbstractContentAccessor.CallbackFileChannel, AbstractContentAccessor.ChannelCloseCallbackAdvise |
Constructor Summary | ||
protected |
AbstractContentWriter(String contentUrl, ContentReader existingContentReader) |
Method Summary | ||
void |
addListener(ContentStreamListener listener) Adds the listener after checking that the output stream isn't already in use. |
|
protected abstract ContentReader |
createReader() A factory method for subclasses to implement that will ensure the proper implementation of the ContentWriter.getReader() method. |
|
protected org.alfresco.repo.content.ContentLimitProvider |
getContentLimitProvider() This method returns the configured ContentLimitProvider for this writer. |
|
getContentOutputStream() Get a stream to write to the underlying channel. |
||
protected abstract WritableByteChannel |
getDirectWritableChannel() Provides low-level access to write content to the repository. |
|
protected ContentReader |
getExistingContentReader() | |
getFileChannel(boolean truncate) Provides read-write, random-access to the underlying content. |
||
getReader() Performs checks and copies required reader attributes |
||
getWritableChannel() Provides low-level access to write to repository content. |
||
void |
guessEncoding() When the content has been written, attempt to guess the encoding of it. |
|
void |
guessMimetype(String filename) When the content has been written, attempt to guess the mimetype of it, using the filename and contents. |
|
boolean |
isChannelOpen() Gets the open/close state of the underlying IO Channel. |
|
boolean |
isClosed() An automatically created listener sets the flag |
|
void |
putContent(ContentReader reader) Copies content from the reader. |
|
void |
putContent(File file) Puts content to the repository direct from file |
|
void |
putContent(InputStream is) Puts content to the repository |
|
void |
putContent(String content) Makes use of the encoding, if available, to convert the string to bytes. |
|
void |
setContentLimitProvider(org.alfresco.repo.content.ContentLimitProvider limitProvider) | |
void |
setMimetypeService(MimetypeService mimetypeService) Supplies the Mimetype Service to be used when guessing encoding and mimetype information. |
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 |
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 writing methods that needs to be implemented by derived classes. All other content access methods make use of this in their underlying implementations.
The channel returned to the client should remain open (subject to timeouts) until closed by the client. All lock detection, read-only access and other concurrency issues are dealt with during this operation. It remains possible that implementations will throw exceptions when the channel is closed.
The stream will notify any listeners according to the listener interface.
Underlying implementations use the truncate
parameter to determine the
most effective means of providing access to the content.
All resources will be closed automatically.
All resources will be closed automatically.
All resources will be closed automatically.
|