Package org.alfresco.ftp.dsl
Class FTPUtil
- java.lang.Object
-
- org.alfresco.ftp.dsl.FTPUtil
-
public class FTPUtil extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description FTPUtil(FTPWrapper ftpWrapper)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontentExists()Verify if a file or folder exists in FTPjava.util.List<org.alfresco.utility.model.ContentModel>getChildren()Get a list of contents (file and folders) from current locationjava.lang.StringgetContent(java.lang.String filePath)Return the content ofjava.util.List<org.alfresco.utility.model.FileModel>getFiles()Get a list of files from current locationintgetFileSize()Get file size.java.util.List<org.alfresco.utility.model.FolderModel>getFolders()Get a list of folders from current locationprotected intgetReplyCode()protected booleanisContentInList(org.alfresco.utility.model.ContentModel contentModel, java.util.List<org.alfresco.utility.model.ContentModel> contents)protected booleanisFileInList(org.alfresco.utility.model.FileModel fileModel, java.util.List<org.alfresco.utility.model.FileModel> files)protected booleanisFolderInList(org.alfresco.utility.model.FolderModel folderModel, java.util.List<org.alfresco.utility.model.FolderModel> folders)java.io.FilesetNewFile(org.alfresco.utility.model.FileModel fileModel)
-
-
-
Constructor Detail
-
FTPUtil
public FTPUtil(FTPWrapper ftpWrapper)
-
-
Method Detail
-
getContent
public java.lang.String getContent(java.lang.String filePath) throws java.io.IOExceptionReturn the content of- Parameters:
filePath-- Returns:
- Throws:
java.io.IOException
-
contentExists
public boolean contentExists() throws java.lang.ExceptionVerify if a file or folder exists in FTP- Returns:
- Throws:
java.lang.Exception
-
isFolderInList
protected boolean isFolderInList(org.alfresco.utility.model.FolderModel folderModel, java.util.List<org.alfresco.utility.model.FolderModel> folders)
-
isFileInList
protected boolean isFileInList(org.alfresco.utility.model.FileModel fileModel, java.util.List<org.alfresco.utility.model.FileModel> files)
-
isContentInList
protected boolean isContentInList(org.alfresco.utility.model.ContentModel contentModel, java.util.List<org.alfresco.utility.model.ContentModel> contents)
-
getFolders
public java.util.List<org.alfresco.utility.model.FolderModel> getFolders() throws java.lang.ExceptionGet a list of folders from current location- Returns:
- List
- Throws:
java.lang.Exception
-
getFiles
public java.util.List<org.alfresco.utility.model.FileModel> getFiles() throws java.lang.ExceptionGet a list of files from current location- Returns:
- List
- Throws:
java.lang.Exception
-
getChildren
public java.util.List<org.alfresco.utility.model.ContentModel> getChildren() throws java.lang.ExceptionGet a list of contents (file and folders) from current location- Returns:
- List
- Throws:
java.lang.Exception
-
setNewFile
public java.io.File setNewFile(org.alfresco.utility.model.FileModel fileModel) throws java.lang.Exception- Throws:
java.lang.Exception
-
getFileSize
public int getFileSize() throws java.lang.ExceptionGet file size. Return 0 if resource is a folder- Returns:
- file size
- Throws:
java.lang.Exception
-
getReplyCode
protected int getReplyCode()
-
-