Class FTPHelper
java.lang.Object
com.logicaldoc.importfolder.helper.CrawlerHelper
com.logicaldoc.importfolder.helper.ftp.FTPHelper
Helper for FTP and FTPS folders
- Since:
- 8.0
- Author:
- Marco Meschieri - LogicalDOC
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidcheckinFile(Object file, long docId, com.logicaldoc.core.security.user.User owner) Imports a remote file into an existing document producing a new versionbooleandeleteFile(Object file) Delete the given referenced file after document import.getContentFile(String path) Retrieves a file that contains the content referenced by pathgetCreationDate(Object file) Computes remote file creation dateGets the object representation of the given pathgetLastModified(Object file) Computes remote file last modification timeComputes the name of the remote fileComputes the path of the remote fileintThe documents, referenced by a index file, that should be imported.com.logicaldoc.core.document.DocumentimportFile(Object file, com.logicaldoc.core.folder.Folder folder, com.logicaldoc.core.security.user.User owner, boolean timestamp) Imports a remote filevoidimportUsingIndex(Crawler crawler) Imports documents referenced by a index filevoidlist(Object parent, int depth, List<Object> folders, List<Object> files, long max, ImportFolderCache cache) Lists all files in a remote folderbooleanTests if the import folder can be accessedMethods inherited from class com.logicaldoc.importfolder.helper.CrawlerHelpergetInstance, toBeImported
- 
Constructor Details- 
FTPHelperpublic FTPHelper(ImportFolder importFolder, Crawler crawler) throws com.logicaldoc.core.PersistenceException - Throws:
- com.logicaldoc.core.PersistenceException
 
 
- 
- 
Method Details- 
checkinFilepublic void checkinFile(Object file, long docId, com.logicaldoc.core.security.user.User owner) throws IOException, com.logicaldoc.core.PersistenceException Description copied from class:CrawlerHelperImports a remote file into an existing document producing a new version- Specified by:
- checkinFilein class- CrawlerHelper
- Parameters:
- file- The file to be loaded
- docId- The document identifier
- owner- The owner user
- Throws:
- IOException- I/O error
- com.logicaldoc.core.PersistenceException- Error in the database layer
 
- 
importFilepublic com.logicaldoc.core.document.Document importFile(Object file, com.logicaldoc.core.folder.Folder folder, com.logicaldoc.core.security.user.User owner, boolean timestamp) throws IOException, com.logicaldoc.core.PersistenceException Description copied from class:CrawlerHelperImports a remote file- Specified by:
- importFilein class- CrawlerHelper
- Parameters:
- file- The file to be loaded
- folder- The target folder
- owner- The owner user
- timestamp- If the timestamp has to be included in filename and title
- Returns:
- The newly created document
- Throws:
- IOException- I/O exception
- com.logicaldoc.core.PersistenceException- Error in the data layer
 
- 
listpublic void list(Object parent, int depth, List<Object> folders, List<Object> files, long max, ImportFolderCache cache) throws IOException Description copied from class:CrawlerHelperLists all files in a remote folder- Specified by:
- listin class- CrawlerHelper
- Parameters:
- parent- The parent directory
- depth- The maximum depth
- folders- The list that will contain all allowed folders
- files- The list that will contain all allowed files
- max- The maximum number of elements in files
- cache- Cache of imported documents
- Throws:
- IOException- I/O error
 
- 
getNameDescription copied from class:CrawlerHelperComputes the name of the remote file- Specified by:
- getNamein class- CrawlerHelper
- Parameters:
- file- The file to be considered
- Returns:
- The name
 
- 
getPathDescription copied from class:CrawlerHelperComputes the path of the remote file- Specified by:
- getPathin class- CrawlerHelper
- Parameters:
- file- The file to be considered
- Returns:
- The path
 
- 
getLastModifiedDescription copied from class:CrawlerHelperComputes remote file last modification time- Specified by:
- getLastModifiedin class- CrawlerHelper
- Parameters:
- file- The file to be considered
- Returns:
- The last modification time
 
- 
getCreationDateDescription copied from class:CrawlerHelperComputes remote file creation date- Specified by:
- getCreationDatein class- CrawlerHelper
- Parameters:
- file- The file to be considered
- Returns:
- The creation date
 
- 
importUsingIndexpublic void importUsingIndex(Crawler crawler) throws IOException, com.logicaldoc.core.PersistenceException, ParserConfigurationException, SAXException Description copied from class:CrawlerHelperImports documents referenced by a index file- Specified by:
- importUsingIndexin class- CrawlerHelper
- Parameters:
- crawler- The current task
- Throws:
- IOException- I/O error
- com.logicaldoc.core.PersistenceException- Error in the database layer
- ParserConfigurationException- XML error
- SAXException- XML error
 
- 
importDocumentsCountpublic int importDocumentsCount() throws IOException, com.logicaldoc.core.PersistenceException, ParserConfigurationException, SAXExceptionDescription copied from class:CrawlerHelperThe documents, referenced by a index file, that should be imported. It returns -1 in case there is not index file- Specified by:
- importDocumentsCountin class- CrawlerHelper
- Returns:
- number of documents references inside the index file
- Throws:
- IOException- I/O error
- com.logicaldoc.core.PersistenceException- Error in the data layer
- ParserConfigurationException- XML error
- SAXException- XML error
 
- 
deleteFileDescription copied from class:CrawlerHelperDelete the given referenced file after document import.- Specified by:
- deleteFilein class- CrawlerHelper
- Parameters:
- file- The file that must be deleted
- Returns:
- if the file has been successfully deleted
 
- 
testConnectionpublic boolean testConnection()Description copied from class:CrawlerHelperTests if the import folder can be accessed- Specified by:
- testConnectionin class- CrawlerHelper
- Returns:
- true if the import folder is accessible
 
- 
getFileDescription copied from class:CrawlerHelperGets the object representation of the given path- Specified by:
- getFilein class- CrawlerHelper
- Parameters:
- path- the full path of a remote file
- Returns:
- the remote file at the specified path
 
- 
getContentFileDescription copied from class:CrawlerHelperRetrieves a file that contains the content referenced by path- Specified by:
- getContentFilein class- CrawlerHelper
- Parameters:
- path- the full path of a remote file
- Returns:
- a local file containing the remote file's content
 
 
-