Class FilesystemContentDataFactory

  • All Implemented Interfaces:
    ContentDataFactory, org.springframework.beans.factory.InitializingBean

    public class FilesystemContentDataFactory
    extends java.lang.Object
    implements ContentDataFactory, org.springframework.beans.factory.InitializingBean
    Factory that creates ContentData out of :
    • a ContentStore
    • a File located within that store's root

    The mimetype will be guessed from the file extension, or fall back to binary. The encoding will be guessed from the file itself, or fall back to defaultEncoding.
    Since:
    4.0
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void afterPropertiesSet()  
      org.alfresco.service.cmr.repository.ContentData createContentData​(org.alfresco.repo.content.ContentStore store, java.io.File contentFile)
      Create a ContentData by combining the given ContentStore's root location and the File's path within that store.
      void setDefaultEncoding​(java.lang.String defaultEncoding)  
      void setMimetypeService​(org.alfresco.service.cmr.repository.MimetypeService mimetypeService)  
      void setStoreProtocol​(java.lang.String storeProtocol)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FilesystemContentDataFactory

        public FilesystemContentDataFactory()
    • Method Detail

      • setMimetypeService

        public void setMimetypeService​(org.alfresco.service.cmr.repository.MimetypeService mimetypeService)
      • setDefaultEncoding

        public void setDefaultEncoding​(java.lang.String defaultEncoding)
      • setStoreProtocol

        public void setStoreProtocol​(java.lang.String storeProtocol)
      • afterPropertiesSet

        public void afterPropertiesSet()
                                throws java.lang.Exception
        Specified by:
        afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
        Throws:
        java.lang.Exception
      • createContentData

        public org.alfresco.service.cmr.repository.ContentData createContentData​(org.alfresco.repo.content.ContentStore store,
                                                                                 java.io.File contentFile)
        Create a ContentData by combining the given ContentStore's root location and the File's path within that store. The given file must therefore be accessible within the content store's configured root location. The encoding and mimetype will be guessed from the given file.
        Specified by:
        createContentData in interface ContentDataFactory
        Parameters:
        store - The ContentStore in which the file should be
        contentFile - The File to check
        Returns:
        the constructed ContentData