Class FilesystemContentDataFactory

java.lang.Object
org.alfresco.repo.bulkimport.impl.FilesystemContentDataFactory
All Implemented Interfaces:
ContentDataFactory, org.springframework.beans.factory.InitializingBean

public class FilesystemContentDataFactory extends Object implements ContentDataFactory, org.springframework.beans.factory.InitializingBean
Factory that creates ContentData out of :
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
  • Constructor Details

    • FilesystemContentDataFactory

      public FilesystemContentDataFactory()
  • Method Details

    • setMimetypeService

      public void setMimetypeService(MimetypeService mimetypeService)
    • setDefaultEncoding

      public void setDefaultEncoding(String defaultEncoding)
    • setStoreProtocol

      public void setStoreProtocol(String storeProtocol)
    • afterPropertiesSet

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

      public ContentData createContentData(ContentStore store, 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