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 forContentReaderwhich capturesInputStreamorReadableByteChannelto introduce a possibility releasing captured resource- Author:
- Dmitry Velichkevich
- See Also:
ContentReader,AbstractStreamAwareProxy
-
-
Constructor Summary
Constructors Constructor Description StreamAwareContentReaderProxy(ContentReader delegator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddListener(ContentStreamListener listener)booleancanBeClosed()booleanexists()voidgetContent(File file)voidgetContent(OutputStream os)ContentDatagetContentData()InputStreamgetContentInputStream()StringgetContentString()StringgetContentString(int length)StringgetContentUrl()StringgetEncoding()FileChannelgetFileChannel()longgetLastModified()LocalegetLocale()StringgetMimetype()ReadableByteChannelgetReadableChannel()ContentReadergetReader()longgetSize()CloseablegetStream()booleanisChannelOpen()booleanisClosed()voidsetEncoding(String encoding)voidsetLocale(Locale locale)voidsetMimetype(String mimetype)-
Methods inherited from class org.alfresco.repo.content.AbstractStreamAwareProxy
release
-
-
-
-
Constructor Detail
-
StreamAwareContentReaderProxy
public StreamAwareContentReaderProxy(ContentReader delegator)
-
-
Method Detail
-
exists
public boolean exists()
- Specified by:
existsin interfaceContentReader
-
getContent
public void getContent(OutputStream os) throws ContentIOException
- Specified by:
getContentin interfaceContentReader- Throws:
ContentIOException
-
getContent
public void getContent(File file) throws ContentIOException
- Specified by:
getContentin interfaceContentReader- Throws:
ContentIOException
-
getContentInputStream
public InputStream getContentInputStream() throws ContentIOException
- Specified by:
getContentInputStreamin interfaceContentReader- Throws:
ContentIOException
-
getContentString
public String getContentString() throws ContentIOException
- Specified by:
getContentStringin interfaceContentReader- Throws:
ContentIOException
-
getContentString
public String getContentString(int length) throws ContentIOException
- Specified by:
getContentStringin interfaceContentReader- Throws:
ContentIOException
-
getFileChannel
public FileChannel getFileChannel() throws ContentIOException
- Specified by:
getFileChannelin interfaceContentReader- Throws:
ContentIOException
-
getLastModified
public long getLastModified()
- Specified by:
getLastModifiedin interfaceContentReader
-
getReadableChannel
public ReadableByteChannel getReadableChannel() throws ContentIOException
- Specified by:
getReadableChannelin interfaceContentReader- Throws:
ContentIOException
-
getReader
public ContentReader getReader() throws ContentIOException
- Specified by:
getReaderin interfaceContentReader- Throws:
ContentIOException
-
isClosed
public boolean isClosed()
- Specified by:
isClosedin interfaceContentReader
-
addListener
public void addListener(ContentStreamListener listener)
- Specified by:
addListenerin interfaceContentAccessor
-
getContentData
public ContentData getContentData()
- Specified by:
getContentDatain interfaceContentAccessor
-
getContentUrl
public String getContentUrl()
- Specified by:
getContentUrlin interfaceContentAccessor
-
getEncoding
public String getEncoding()
- Specified by:
getEncodingin interfaceContentAccessor
-
getLocale
public Locale getLocale()
- Specified by:
getLocalein interfaceContentAccessor
-
getMimetype
public String getMimetype()
- Specified by:
getMimetypein interfaceContentAccessor
-
getSize
public long getSize()
- Specified by:
getSizein interfaceContentAccessor
-
isChannelOpen
public boolean isChannelOpen()
- Specified by:
isChannelOpenin interfaceContentAccessor
-
setEncoding
public void setEncoding(String encoding)
- Specified by:
setEncodingin interfaceContentAccessor
-
setLocale
public void setLocale(Locale locale)
- Specified by:
setLocalein interfaceContentAccessor
-
setMimetype
public void setMimetype(String mimetype)
- 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
public Closeable getStream()
- Specified by:
getStreamin classAbstractStreamAwareProxy- Returns:
Closeableinstance which represents channel or stream which uses channel
-
-