Package org.alfresco.repo.importer
Class FileImporterImpl
java.lang.Object
org.alfresco.repo.importer.FileImporterImpl
- All Implemented Interfaces:
FileImporter
Simple import of content into the repository
- Author:
- andyh
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintLoad a single file or directory without any recursionintLoad 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)
-
Constructor Details
-
FileImporterImpl
public FileImporterImpl()
-
-
Method Details
-
loadFile
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
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
-
setContentService
-
setMimetypeService
-
setNodeService
-
setDictionaryService
-
setTransactionService
-
setTxnPerFile
public void setTxnPerFile(boolean txnPerFile) - Parameters:
txnPerFile- true to force each file or directory creation to be in its own file
-