Class ContentCacheImpl.CacheWriter
- java.lang.Object
-
- org.alfresco.repo.content.AbstractContentAccessor
-
- org.alfresco.repo.content.AbstractContentWriter
-
- org.alfresco.repo.content.filestore.FileContentWriter
-
- org.alfresco.repo.content.caching.ContentCacheImpl.CacheWriter
-
- All Implemented Interfaces:
ContentAccessor,ContentWriter,MimetypeServiceAware
- Enclosing class:
- ContentCacheImpl
public static class ContentCacheImpl.CacheWriter extends FileContentWriter
This FileContentWriter subclass allows for the temp cache file to be renamed to a cache file proper, e.g filename.tmp becomes filename.bin- Author:
- Matt Ward
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.alfresco.repo.content.AbstractContentAccessor
AbstractContentAccessor.CallbackFileChannel, AbstractContentAccessor.ChannelCloseCallbackAdvise
-
-
Constructor Summary
Constructors Constructor Description CacheWriter(File file, String url)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ContentReadercreateReader()The URL of the write is known from the start and this method contract states that no consideration needs to be taken w.r.t.FilegetFile()longgetSize()voidsetCacheFile(File file)-
Methods inherited from class org.alfresco.repo.content.filestore.FileContentWriter
canWrite, getDirectWritableChannel
-
Methods inherited from class org.alfresco.repo.content.AbstractContentWriter
addListener, getContentLimitProvider, getContentOutputStream, getExistingContentReader, getFileChannel, getReader, getWritableChannel, guessEncoding, guessMimetype, isChannelOpen, isClosed, putContent, putContent, putContent, putContent, setContentLimitProvider, setMimetypeService
-
Methods inherited from class org.alfresco.repo.content.AbstractContentAccessor
channelOpened, finalize, getCallbackFileChannel, getContentData, getContentUrl, getEncoding, getLocale, getMimetype, setContentUrl, setEncoding, setLocale, setMimetype, toString
-
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.alfresco.service.cmr.repository.ContentAccessor
getContentData, getContentUrl, getEncoding, getLocale, getMimetype, setEncoding, setLocale, setMimetype
-
-
-
-
Method Detail
-
setCacheFile
public void setCacheFile(File file)
-
getFile
public File getFile()
- Overrides:
getFilein classFileContentWriter- Returns:
- Returns the file that this writer accesses
-
createReader
protected ContentReader createReader() throws ContentIOException
Description copied from class:FileContentWriterThe URL of the write is known from the start and this method contract states that no consideration needs to be taken w.r.t. the stream state.- Overrides:
createReaderin classFileContentWriter- Returns:
- Returns a reader onto the location referenced by this instance. The instance must always be a new instance and never null.
- Throws:
ContentIOException
-
getSize
public long getSize()
- Specified by:
getSizein interfaceContentAccessor- Overrides:
getSizein classFileContentWriter- Returns:
- Returns the size of the underlying file or
-
-