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 forContentWriterwhich capturesOutputStreamorWritableByteChannelto introduce a possibility of releasing captured resource- Author:
- Dmitry Velichkevich
- See Also:
ContentWriter,AbstractStreamAwareProxy
-
-
Constructor Summary
Constructors Constructor Description StreamAwareContentWriterProxy(ContentWriter delegator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddListener(ContentStreamListener listener)booleancanBeClosed()ContentDatagetContentData()OutputStreamgetContentOutputStream()StringgetContentUrl()StringgetEncoding()FileChannelgetFileChannel(boolean truncate)LocalegetLocale()StringgetMimetype()ContentReadergetReader()longgetSize()CloseablegetStream()WritableByteChannelgetWritableChannel()voidguessEncoding()voidguessMimetype(String filename)booleanisChannelOpen()booleanisClosed()voidputContent(File file)voidputContent(InputStream is)voidputContent(String content)voidputContent(ContentReader reader)voidsetEncoding(String encoding)voidsetLocale(Locale locale)voidsetMimetype(String mimetype)-
Methods inherited from class org.alfresco.repo.content.AbstractStreamAwareProxy
release
-
-
-
-
Constructor Detail
-
StreamAwareContentWriterProxy
public StreamAwareContentWriterProxy(ContentWriter delegator)
-
-
Method Detail
-
getContentOutputStream
public OutputStream getContentOutputStream() throws ContentIOException
- Specified by:
getContentOutputStreamin interfaceContentWriter- Throws:
ContentIOException
-
getFileChannel
public FileChannel getFileChannel(boolean truncate) throws ContentIOException
- Specified by:
getFileChannelin interfaceContentWriter- Throws:
ContentIOException
-
getReader
public ContentReader getReader() throws ContentIOException
- Specified by:
getReaderin interfaceContentWriter- Throws:
ContentIOException
-
getWritableChannel
public WritableByteChannel getWritableChannel() throws ContentIOException
- Specified by:
getWritableChannelin interfaceContentWriter- Throws:
ContentIOException
-
guessEncoding
public void guessEncoding()
- Specified by:
guessEncodingin interfaceContentWriter
-
guessMimetype
public void guessMimetype(String filename)
- Specified by:
guessMimetypein interfaceContentWriter
-
isClosed
public boolean isClosed()
- Specified by:
isClosedin interfaceContentWriter
-
putContent
public void putContent(ContentReader reader) throws ContentIOException
- Specified by:
putContentin interfaceContentWriter- Throws:
ContentIOException
-
putContent
public void putContent(InputStream is) throws ContentIOException
- Specified by:
putContentin interfaceContentWriter- Throws:
ContentIOException
-
putContent
public void putContent(File file) throws ContentIOException
- Specified by:
putContentin interfaceContentWriter- Throws:
ContentIOException
-
putContent
public void putContent(String content) throws ContentIOException
- Specified by:
putContentin interfaceContentWriter- Throws:
ContentIOException
-
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
-
-