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:
-
Constructor Summary
ConstructorsConstructorDescriptionBackingStoreAwareCacheWriter(ContentWriter cacheWriter, ContentWriter bsWriter) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(ContentStreamListener listener) getFileChannel(boolean truncate) longgetSize()voidvoidguessMimetype(String filename) booleanbooleanisClosed()voidputContent(File file) voidvoidputContent(String content) voidputContent(ContentReader reader) voidsetEncoding(String encoding) voidvoidsetMimetype(String mimetype) voidsetMimetypeService(MimetypeService mimetypeService)
-
Constructor Details
-
BackingStoreAwareCacheWriter
-
-
Method Details
-
isChannelOpen
public boolean isChannelOpen()- Specified by:
isChannelOpenin interfaceContentAccessor
-
addListener
- Specified by:
addListenerin interfaceContentAccessor
-
getSize
public long getSize()- Specified by:
getSizein interfaceContentAccessor
-
getContentData
- Specified by:
getContentDatain interfaceContentAccessor
-
getContentUrl
- Specified by:
getContentUrlin interfaceContentAccessor
-
getMimetype
- Specified by:
getMimetypein interfaceContentAccessor
-
setMimetype
- Specified by:
setMimetypein interfaceContentAccessor
-
getEncoding
- Specified by:
getEncodingin interfaceContentAccessor
-
setEncoding
- Specified by:
setEncodingin interfaceContentAccessor
-
getLocale
- Specified by:
getLocalein interfaceContentAccessor
-
setLocale
- Specified by:
setLocalein interfaceContentAccessor
-
getReader
- Specified by:
getReaderin interfaceContentWriter- Throws:
ContentIOException
-
isClosed
public boolean isClosed()- Specified by:
isClosedin interfaceContentWriter
-
getWritableChannel
- Specified by:
getWritableChannelin interfaceContentWriter- Throws:
ContentIOException
-
getFileChannel
- Specified by:
getFileChannelin interfaceContentWriter- Throws:
ContentIOException
-
getContentOutputStream
- Specified by:
getContentOutputStreamin interfaceContentWriter- Throws:
ContentIOException
-
putContent
- Specified by:
putContentin interfaceContentWriter- Throws:
ContentIOException
-
putContent
- Specified by:
putContentin interfaceContentWriter- Throws:
ContentIOException
-
putContent
- Specified by:
putContentin interfaceContentWriter- Throws:
ContentIOException
-
putContent
- Specified by:
putContentin interfaceContentWriter- Throws:
ContentIOException
-
guessMimetype
- Specified by:
guessMimetypein interfaceContentWriter
-
guessEncoding
public void guessEncoding()- Specified by:
guessEncodingin interfaceContentWriter
-
setMimetypeService
- Specified by:
setMimetypeServicein interfaceMimetypeServiceAware
-