org.alfresco.repo.importer
Class FileImporterImpl

java.lang.Object
  extended by 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


Constructor Summary
FileImporterImpl()
           
 
Method Summary
 int loadFile(org.alfresco.service.cmr.repository.NodeRef container, java.io.File file)
          Load a single file or directory without any recursion
 int loadFile(org.alfresco.service.cmr.repository.NodeRef container, java.io.File file, boolean recurse)
          Load a file or directory into the repository
 int loadFile(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 directory
 int loadNamedFile(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  void setAuthenticationService(AuthenticationService authenticationService)
           
protected  void setContentService(ContentService contentService)
           
 void setDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)
           
protected  void setMimetypeService(org.alfresco.service.cmr.repository.MimetypeService mimetypeService)
           
protected  void setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
           
 void setTransactionService(TransactionService transactionService)
           
 void setTxnPerFile(boolean txnPerFile)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileImporterImpl

public FileImporterImpl()
Method Detail

loadFile

public int loadFile(org.alfresco.service.cmr.repository.NodeRef container,
                    java.io.File file,
                    boolean recurse)
             throws FileImporterException
Description copied from interface: FileImporter
Load a file or directory into the repository

Specified by:
loadFile in interface FileImporter
Parameters:
container - - the node into which to insert the file or directory
file - - the start point for the import
recurse - - 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 FileImporterException
Description copied from interface: FileImporter
Load a file into a given location, giving it a new name.

Specified by:
loadNamedFile in interface FileImporter
Parameters:
container - the target parent to load into
file - the source file to upload
recurse - true to recurse into subfolders
name - 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 FileImporterException
Description copied from interface: FileImporter
Load all files or directories that match the file filter in the given directory

Specified by:
loadFile in interface FileImporter
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 FileImporterException
Description copied from interface: FileImporter
Load a single file or directory without any recursion

Specified by:
loadFile in interface FileImporter
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


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