Class FilesystemContentDataFactory
- java.lang.Object
-
- 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 createsContentDataout of :- a
ContentStore - a
Filelocated 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 todefaultEncoding.- Since:
- 4.0
-
-
Constructor Summary
Constructors Constructor Description FilesystemContentDataFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterPropertiesSet()org.alfresco.service.cmr.repository.ContentDatacreateContentData(org.alfresco.repo.content.ContentStore store, java.io.File contentFile)Create aContentDataby combining the givenContentStore's root location and theFile's path within that store.voidsetDefaultEncoding(java.lang.String defaultEncoding)voidsetMimetypeService(org.alfresco.service.cmr.repository.MimetypeService mimetypeService)voidsetStoreProtocol(java.lang.String storeProtocol)
-
-
-
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:
afterPropertiesSetin interfaceorg.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 aContentDataby combining the givenContentStore's root location and theFile'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:
createContentDatain interfaceContentDataFactory- Parameters:
store- TheContentStorein which the file should becontentFile- TheFileto check- Returns:
- the constructed
ContentData
-
-