Class 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
    • Constructor Detail

      • CacheWriter

        public 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