Package org.alfresco.repo.content
Class StreamAwareContentReaderProxy
java.lang.Object
org.alfresco.repo.content.AbstractStreamAwareProxy
org.alfresco.repo.content.StreamAwareContentReaderProxy
- All Implemented Interfaces:
ContentAccessor,ContentReader
public class StreamAwareContentReaderProxy
extends AbstractStreamAwareProxy
implements ContentReader
Proxy for
ContentReader which captures InputStream or ReadableByteChannel to introduce a possibility releasing captured resource- Author:
- Dmitry Velichkevich
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(ContentStreamListener listener) booleanbooleanexists()voidgetContent(File file) voidgetContentString(int length) longlonggetSize()booleanbooleanisClosed()voidsetEncoding(String encoding) voidvoidsetMimetype(String mimetype) Methods inherited from class org.alfresco.repo.content.AbstractStreamAwareProxy
release
-
Constructor Details
-
StreamAwareContentReaderProxy
-
-
Method Details
-
exists
public boolean exists()- Specified by:
existsin interfaceContentReader
-
getContent
- Specified by:
getContentin interfaceContentReader- Throws:
ContentIOException
-
getContent
- Specified by:
getContentin interfaceContentReader- Throws:
ContentIOException
-
getContentInputStream
- Specified by:
getContentInputStreamin interfaceContentReader- Throws:
ContentIOException
-
getContentString
- Specified by:
getContentStringin interfaceContentReader- Throws:
ContentIOException
-
getContentString
- Specified by:
getContentStringin interfaceContentReader- Throws:
ContentIOException
-
getFileChannel
- Specified by:
getFileChannelin interfaceContentReader- Throws:
ContentIOException
-
getLastModified
public long getLastModified()- Specified by:
getLastModifiedin interfaceContentReader
-
getReadableChannel
- Specified by:
getReadableChannelin interfaceContentReader- Throws:
ContentIOException
-
getReader
- Specified by:
getReaderin interfaceContentReader- Throws:
ContentIOException
-
isClosed
public boolean isClosed()- Specified by:
isClosedin interfaceContentReader
-
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
-