Package org.alfresco.repo.importer
Class FileImporterImpl
- java.lang.Object
-
- org.alfresco.repo.importer.FileImporterImpl
-
- All Implemented Interfaces:
FileImporter
public class FileImporterImpl extends 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(NodeRef container, File file)Load a single file or directory without any recursionintloadFile(NodeRef container, File file, boolean recurse)Load a file or directory into the repositoryintloadFile(NodeRef container, File file, FileFilter filter, boolean recurse)Load all files or directories that match the file filter in the given directoryintloadNamedFile(NodeRef container, File file, boolean recurse, String name)Load a file into a given location, giving it a new name.protected voidsetAuthenticationService(AuthenticationService authenticationService)protected voidsetContentService(ContentService contentService)voidsetDictionaryService(DictionaryService dictionaryService)protected voidsetMimetypeService(MimetypeService mimetypeService)protected voidsetNodeService(NodeService nodeService)voidsetTransactionService(TransactionService transactionService)voidsetTxnPerFile(boolean txnPerFile)
-
-
-
Method Detail
-
loadFile
public int loadFile(NodeRef container, File file, boolean recurse) throws FileImporterException
Description 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(NodeRef container, File file, boolean recurse, String name) throws FileImporterException
Description 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(NodeRef container, File file, FileFilter filter, boolean recurse) throws FileImporterException
Description 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(NodeRef container, File file) throws FileImporterException
Description 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(MimetypeService mimetypeService)
-
setNodeService
protected void setNodeService(NodeService nodeService)
-
setDictionaryService
public void setDictionaryService(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
-
-