Class BackingStoreAwareCacheWriter
- java.lang.Object
-
- org.alfresco.repo.content.caching.BackingStoreAwareCacheWriter
-
- All Implemented Interfaces:
ContentAccessor,ContentWriter,MimetypeServiceAware
public class BackingStoreAwareCacheWriter extends Object implements ContentWriter, MimetypeServiceAware
Wrapper for cache writer that is aware of backing store writer and calls backing store for getSize and getContentData in case if cache file was deleted- Author:
- Viachaslau Tsikhanovich
- See Also:
- MNT-9663
-
-
Constructor Summary
Constructors Constructor Description BackingStoreAwareCacheWriter(ContentWriter cacheWriter, ContentWriter bsWriter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddListener(ContentStreamListener listener)ContentDatagetContentData()OutputStreamgetContentOutputStream()StringgetContentUrl()StringgetEncoding()FileChannelgetFileChannel(boolean truncate)LocalegetLocale()StringgetMimetype()ContentReadergetReader()longgetSize()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)voidsetMimetypeService(MimetypeService mimetypeService)
-
-
-
Constructor Detail
-
BackingStoreAwareCacheWriter
public BackingStoreAwareCacheWriter(ContentWriter cacheWriter, ContentWriter bsWriter)
-
-
Method Detail
-
isChannelOpen
public boolean isChannelOpen()
- Specified by:
isChannelOpenin interfaceContentAccessor
-
addListener
public void addListener(ContentStreamListener listener)
- Specified by:
addListenerin interfaceContentAccessor
-
getSize
public long getSize()
- Specified by:
getSizein interfaceContentAccessor
-
getContentData
public ContentData getContentData()
- Specified by:
getContentDatain interfaceContentAccessor
-
getContentUrl
public String getContentUrl()
- Specified by:
getContentUrlin interfaceContentAccessor
-
getMimetype
public String getMimetype()
- Specified by:
getMimetypein interfaceContentAccessor
-
setMimetype
public void setMimetype(String mimetype)
- Specified by:
setMimetypein interfaceContentAccessor
-
getEncoding
public String getEncoding()
- Specified by:
getEncodingin interfaceContentAccessor
-
setEncoding
public void setEncoding(String encoding)
- Specified by:
setEncodingin interfaceContentAccessor
-
getLocale
public Locale getLocale()
- Specified by:
getLocalein interfaceContentAccessor
-
setLocale
public void setLocale(Locale locale)
- Specified by:
setLocalein interfaceContentAccessor
-
getReader
public ContentReader getReader() throws ContentIOException
- Specified by:
getReaderin interfaceContentWriter- Throws:
ContentIOException
-
isClosed
public boolean isClosed()
- Specified by:
isClosedin interfaceContentWriter
-
getWritableChannel
public WritableByteChannel getWritableChannel() throws ContentIOException
- Specified by:
getWritableChannelin interfaceContentWriter- Throws:
ContentIOException
-
getFileChannel
public FileChannel getFileChannel(boolean truncate) throws ContentIOException
- Specified by:
getFileChannelin interfaceContentWriter- Throws:
ContentIOException
-
getContentOutputStream
public OutputStream getContentOutputStream() throws ContentIOException
- Specified by:
getContentOutputStreamin interfaceContentWriter- Throws:
ContentIOException
-
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
-
guessMimetype
public void guessMimetype(String filename)
- Specified by:
guessMimetypein interfaceContentWriter
-
guessEncoding
public void guessEncoding()
- Specified by:
guessEncodingin interfaceContentWriter
-
setMimetypeService
public void setMimetypeService(MimetypeService mimetypeService)
- Specified by:
setMimetypeServicein interfaceMimetypeServiceAware
-
-