org.alfresco.repo.bulkimport.impl
Class FilesystemContentDataFactory

java.lang.Object
  extended by org.alfresco.repo.bulkimport.impl.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 :


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 FilesystemContentDataFactory.defaultEncoding.

Since:
4.0

Constructor Summary
FilesystemContentDataFactory()
           
 
Method Summary
 void afterPropertiesSet()
           
 org.alfresco.service.cmr.repository.ContentData createContentData(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(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


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