public class StreamAwareContentWriterProxy extends AbstractStreamAwareProxy implements org.alfresco.service.cmr.repository.ContentWriter
ContentWriter
which captures OutputStream
or WritableByteChannel
to introduce a possibility of releasing captured resourceContentWriter
,
AbstractStreamAwareProxy
Constructor and Description |
---|
StreamAwareContentWriterProxy(org.alfresco.service.cmr.repository.ContentWriter delegator) |
Modifier and Type | Method and Description |
---|---|
void |
addListener(org.alfresco.service.cmr.repository.ContentStreamListener listener) |
boolean |
canBeClosed() |
org.alfresco.service.cmr.repository.ContentData |
getContentData() |
OutputStream |
getContentOutputStream() |
String |
getContentUrl() |
String |
getEncoding() |
FileChannel |
getFileChannel(boolean truncate) |
Locale |
getLocale() |
String |
getMimetype() |
org.alfresco.service.cmr.repository.ContentReader |
getReader() |
long |
getSize() |
Closeable |
getStream() |
WritableByteChannel |
getWritableChannel() |
void |
guessEncoding() |
void |
guessMimetype(String filename) |
boolean |
isChannelOpen() |
boolean |
isClosed() |
void |
putContent(org.alfresco.service.cmr.repository.ContentReader reader) |
void |
putContent(File file) |
void |
putContent(InputStream is) |
void |
putContent(String content) |
void |
setEncoding(String encoding) |
void |
setLocale(Locale locale) |
void |
setMimetype(String mimetype) |
release
public StreamAwareContentWriterProxy(org.alfresco.service.cmr.repository.ContentWriter delegator)
public OutputStream getContentOutputStream() throws org.alfresco.service.cmr.repository.ContentIOException
getContentOutputStream
in interface org.alfresco.service.cmr.repository.ContentWriter
org.alfresco.service.cmr.repository.ContentIOException
public FileChannel getFileChannel(boolean truncate) throws org.alfresco.service.cmr.repository.ContentIOException
getFileChannel
in interface org.alfresco.service.cmr.repository.ContentWriter
org.alfresco.service.cmr.repository.ContentIOException
public org.alfresco.service.cmr.repository.ContentReader getReader() throws org.alfresco.service.cmr.repository.ContentIOException
getReader
in interface org.alfresco.service.cmr.repository.ContentWriter
org.alfresco.service.cmr.repository.ContentIOException
public WritableByteChannel getWritableChannel() throws org.alfresco.service.cmr.repository.ContentIOException
getWritableChannel
in interface org.alfresco.service.cmr.repository.ContentWriter
org.alfresco.service.cmr.repository.ContentIOException
public void guessEncoding()
guessEncoding
in interface org.alfresco.service.cmr.repository.ContentWriter
public void guessMimetype(String filename)
guessMimetype
in interface org.alfresco.service.cmr.repository.ContentWriter
public boolean isClosed()
isClosed
in interface org.alfresco.service.cmr.repository.ContentWriter
public void putContent(org.alfresco.service.cmr.repository.ContentReader reader) throws org.alfresco.service.cmr.repository.ContentIOException
putContent
in interface org.alfresco.service.cmr.repository.ContentWriter
org.alfresco.service.cmr.repository.ContentIOException
public void putContent(InputStream is) throws org.alfresco.service.cmr.repository.ContentIOException
putContent
in interface org.alfresco.service.cmr.repository.ContentWriter
org.alfresco.service.cmr.repository.ContentIOException
public void putContent(File file) throws org.alfresco.service.cmr.repository.ContentIOException
putContent
in interface org.alfresco.service.cmr.repository.ContentWriter
org.alfresco.service.cmr.repository.ContentIOException
public void putContent(String content) throws org.alfresco.service.cmr.repository.ContentIOException
putContent
in interface org.alfresco.service.cmr.repository.ContentWriter
org.alfresco.service.cmr.repository.ContentIOException
public void addListener(org.alfresco.service.cmr.repository.ContentStreamListener listener)
addListener
in interface org.alfresco.service.cmr.repository.ContentAccessor
public org.alfresco.service.cmr.repository.ContentData getContentData()
getContentData
in interface org.alfresco.service.cmr.repository.ContentAccessor
public String getContentUrl()
getContentUrl
in interface org.alfresco.service.cmr.repository.ContentAccessor
public String getEncoding()
getEncoding
in interface org.alfresco.service.cmr.repository.ContentAccessor
public Locale getLocale()
getLocale
in interface org.alfresco.service.cmr.repository.ContentAccessor
public String getMimetype()
getMimetype
in interface org.alfresco.service.cmr.repository.ContentAccessor
public long getSize()
getSize
in interface org.alfresco.service.cmr.repository.ContentAccessor
public boolean isChannelOpen()
isChannelOpen
in interface org.alfresco.service.cmr.repository.ContentAccessor
public void setEncoding(String encoding)
setEncoding
in interface org.alfresco.service.cmr.repository.ContentAccessor
public void setLocale(Locale locale)
setLocale
in interface org.alfresco.service.cmr.repository.ContentAccessor
public void setMimetype(String mimetype)
setMimetype
in interface org.alfresco.service.cmr.repository.ContentAccessor
public boolean canBeClosed()
canBeClosed
in class AbstractStreamAwareProxy
Boolean
value which determines whether stream can (true
) or cannot ((false
)) be closedpublic Closeable getStream()
getStream
in class AbstractStreamAwareProxy
Closeable
instance which represents channel or stream which uses channelCopyright © 2005–2017 Alfresco Software. All rights reserved.