Package org.alfresco.repo.content
Class StreamAwareContentWriterProxy
java.lang.Object
org.alfresco.repo.content.AbstractStreamAwareProxy
org.alfresco.repo.content.StreamAwareContentWriterProxy
- All Implemented Interfaces:
ContentAccessor,ContentWriter
public class StreamAwareContentWriterProxy
extends AbstractStreamAwareProxy
implements ContentWriter
Proxy for
ContentWriter which captures OutputStream or WritableByteChannel to introduce a possibility of releasing captured resource- Author:
- Dmitry Velichkevich
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(ContentStreamListener listener) booleangetFileChannel(boolean truncate) longgetSize()voidvoidguessMimetype(String filename) booleanbooleanisClosed()voidputContent(File file) voidvoidputContent(String content) voidputContent(ContentReader reader) voidsetEncoding(String encoding) voidvoidsetMimetype(String mimetype) Methods inherited from class org.alfresco.repo.content.AbstractStreamAwareProxy
release
-
Constructor Details
-
StreamAwareContentWriterProxy
-
-
Method Details
-
getContentOutputStream
- Specified by:
getContentOutputStreamin interfaceContentWriter- Throws:
ContentIOException
-
getFileChannel
- Specified by:
getFileChannelin interfaceContentWriter- Throws:
ContentIOException
-
getReader
- Specified by:
getReaderin interfaceContentWriter- Throws:
ContentIOException
-
getWritableChannel
- Specified by:
getWritableChannelin interfaceContentWriter- Throws:
ContentIOException
-
guessEncoding
public void guessEncoding()- Specified by:
guessEncodingin interfaceContentWriter
-
guessMimetype
- Specified by:
guessMimetypein interfaceContentWriter
-
isClosed
public boolean isClosed()- Specified by:
isClosedin interfaceContentWriter
-
putContent
- Specified by:
putContentin interfaceContentWriter- Throws:
ContentIOException
-
putContent
- Specified by:
putContentin interfaceContentWriter- Throws:
ContentIOException
-
putContent
- Specified by:
putContentin interfaceContentWriter- Throws:
ContentIOException
-
putContent
- Specified by:
putContentin interfaceContentWriter- Throws:
ContentIOException
-
addListener
- Specified by:
addListenerin interfaceContentAccessor
-
getContentData
- Specified by:
getContentDatain interfaceContentAccessor
-
getContentUrl
- Specified by:
getContentUrlin interfaceContentAccessor
-
getEncoding
- Specified by:
getEncodingin interfaceContentAccessor
-
getLocale
- Specified by:
getLocalein interfaceContentAccessor
-
getMimetype
- Specified by:
getMimetypein interfaceContentAccessor
-
getSize
public long getSize()- Specified by:
getSizein interfaceContentAccessor
-
isChannelOpen
public boolean isChannelOpen()- Specified by:
isChannelOpenin interfaceContentAccessor
-
setEncoding
- Specified by:
setEncodingin interfaceContentAccessor
-
setLocale
- Specified by:
setLocalein interfaceContentAccessor
-
setMimetype
- Specified by:
setMimetypein interfaceContentAccessor
-
canBeClosed
public boolean canBeClosed()- Specified by:
canBeClosedin classAbstractStreamAwareProxy- Returns:
Booleanvalue which determines whether stream can (true) or cannot ((false)) be closed
-
getStream
- Specified by:
getStreamin classAbstractStreamAwareProxy- Returns:
Closeableinstance which represents channel or stream which uses channel
-