Package org.alfresco.repo.importer
Class FileImporterImpl
- java.lang.Object
-
- org.alfresco.repo.importer.FileImporterImpl
-
- All Implemented Interfaces:
FileImporter
public class FileImporterImpl extends java.lang.Object implements FileImporter
Simple import of content into the repository- Author:
- andyh
-
-
Constructor Summary
Constructors Constructor Description FileImporterImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intloadFile(org.alfresco.service.cmr.repository.NodeRef container, java.io.File file)Load a single file or directory without any recursionintloadFile(org.alfresco.service.cmr.repository.NodeRef container, java.io.File file, boolean recurse)Load a file or directory into the repositoryintloadFile(org.alfresco.service.cmr.repository.NodeRef container, java.io.File file, java.io.FileFilter filter, boolean recurse)Load all files or directories that match the file filter in the given directoryintloadNamedFile(org.alfresco.service.cmr.repository.NodeRef container, java.io.File file, boolean recurse, java.lang.String name)Load a file into a given location, giving it a new name.protected voidsetAuthenticationService(AuthenticationService authenticationService)protected voidsetContentService(ContentService contentService)voidsetDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)protected voidsetMimetypeService(org.alfresco.service.cmr.repository.MimetypeService mimetypeService)protected voidsetNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)voidsetTransactionService(TransactionService transactionService)voidsetTxnPerFile(boolean txnPerFile)
-
-
-
Method Detail
-
loadFile
public int loadFile(org.alfresco.service.cmr.repository.NodeRef container, java.io.File file, boolean recurse) throws FileImporterExceptionDescription copied from interface:FileImporterLoad a file or directory into the repository- Specified by:
loadFilein interfaceFileImporter- Parameters:
container- - the node into which to insert the file or directoryfile- - the start point for the importrecurse- - if the start point is a directoty then recurse- Returns:
- Returns the number of successfully imported files and directories
- Throws:
FileImporterException
-
loadNamedFile
public int loadNamedFile(org.alfresco.service.cmr.repository.NodeRef container, java.io.File file, boolean recurse, java.lang.String name) throws FileImporterExceptionDescription copied from interface:FileImporterLoad a file into a given location, giving it a new name.- Specified by:
loadNamedFilein interfaceFileImporter- Parameters:
container- the target parent to load intofile- the source file to uploadrecurse- true to recurse into subfoldersname- the new name of the file or folder when it gets uploaded- Returns:
- Returns the number of files loaded
- Throws:
FileImporterException
-
loadFile
public int loadFile(org.alfresco.service.cmr.repository.NodeRef container, java.io.File file, java.io.FileFilter filter, boolean recurse) throws FileImporterExceptionDescription copied from interface:FileImporterLoad all files or directories that match the file filter in the given directory- Specified by:
loadFilein interfaceFileImporter- Parameters:
container- NodeReffile- Filefilter- FileFilterrecurse- boolean- Returns:
- Returns the number of successfully imported files and directories
- Throws:
FileImporterException
-
loadFile
public int loadFile(org.alfresco.service.cmr.repository.NodeRef container, java.io.File file) throws FileImporterExceptionDescription copied from interface:FileImporterLoad a single file or directory without any recursion- Specified by:
loadFilein interfaceFileImporter- Parameters:
container- NodeReffile- File- Returns:
- Returns the number of successfully imported files and directories
- Throws:
FileImporterException
-
setAuthenticationService
protected void setAuthenticationService(AuthenticationService authenticationService)
-
setContentService
protected void setContentService(ContentService contentService)
-
setMimetypeService
protected void setMimetypeService(org.alfresco.service.cmr.repository.MimetypeService mimetypeService)
-
setNodeService
protected void setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
-
setDictionaryService
public void setDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)
-
setTransactionService
public void setTransactionService(TransactionService transactionService)
-
setTxnPerFile
public void setTxnPerFile(boolean txnPerFile)
- Parameters:
txnPerFile- true to force each file or directory creation to be in its own file
-
-