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:
org.alfresco.service.cmr.repository.ContentAccessor,org.alfresco.service.cmr.repository.ContentWriter,org.alfresco.service.cmr.repository.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(java.io.File file, java.lang.String url)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.alfresco.service.cmr.repository.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.java.io.FilegetFile()longgetSize()voidsetCacheFile(java.io.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
-
-
-
-
Method Detail
-
setCacheFile
public void setCacheFile(java.io.File file)
-
getFile
public java.io.File getFile()
- Overrides:
getFilein classFileContentWriter- Returns:
- Returns the file that this writer accesses
-
createReader
protected org.alfresco.service.cmr.repository.ContentReader createReader() throws org.alfresco.service.cmr.repository.ContentIOExceptionDescription 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:
org.alfresco.service.cmr.repository.ContentIOException
-
getSize
public long getSize()
- Specified by:
getSizein interfaceorg.alfresco.service.cmr.repository.ContentAccessor- Overrides:
getSizein classFileContentWriter- Returns:
- Returns the size of the underlying file or
-
-