org.alfresco.repo.content.caching
Class ContentCacheImpl.CacheWriter

java.lang.Object
  extended by org.alfresco.repo.content.AbstractContentAccessor
      extended by org.alfresco.repo.content.AbstractContentWriter
          extended by org.alfresco.repo.content.filestore.FileContentWriter
              extended by org.alfresco.repo.content.caching.ContentCacheImpl.CacheWriter
All Implemented Interfaces:
org.alfresco.service.cmr.repository.ContentAccessor, org.alfresco.service.cmr.repository.ContentWriter
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


Nested Class Summary
 
Nested classes/interfaces inherited from class org.alfresco.repo.content.AbstractContentAccessor
AbstractContentAccessor.CallbackFileChannel, AbstractContentAccessor.ChannelCloseCallbackAdvise
 
Constructor Summary
ContentCacheImpl.CacheWriter(java.io.File file, java.lang.String url)
           
 
Method Summary
protected  org.alfresco.service.cmr.repository.ContentReader createReader()
          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.File getFile()
           
 long getSize()
           
 void setCacheFile(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, getContentOutputStream, getExistingContentReader, getFileChannel, getReader, getWritableChannel, guessEncoding, guessMimetype, isChannelOpen, isClosed, putContent, putContent, putContent, putContent, 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
 

Constructor Detail

ContentCacheImpl.CacheWriter

public ContentCacheImpl.CacheWriter(java.io.File file,
                                    java.lang.String url)
Method Detail

setCacheFile

public void setCacheFile(java.io.File file)

getFile

public java.io.File getFile()
Overrides:
getFile in class FileContentWriter
Returns:
Returns the file that this writer accesses

createReader

protected org.alfresco.service.cmr.repository.ContentReader createReader()
                                                                  throws org.alfresco.service.cmr.repository.ContentIOException
Description copied from class: FileContentWriter
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. the stream state.

Overrides:
createReader in class FileContentWriter
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:
getSize in interface org.alfresco.service.cmr.repository.ContentAccessor
Overrides:
getSize in class FileContentWriter
Returns:
Returns the size of the underlying file or


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.