Class 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
      boolean contentExists()
      Verify if a file or folder exists in FTP
      java.util.List<org.alfresco.utility.model.ContentModel> getChildren()
      Get a list of contents (file and folders) from current location
      java.lang.String getContent​(java.lang.String filePath)
      Return the content of
      java.util.List<org.alfresco.utility.model.FileModel> getFiles()
      Get a list of files from current location
      int getFileSize()
      Get file size.
      java.util.List<org.alfresco.utility.model.FolderModel> getFolders()
      Get a list of folders from current location
      protected int getReplyCode()  
      protected boolean isContentInList​(org.alfresco.utility.model.ContentModel contentModel, java.util.List<org.alfresco.utility.model.ContentModel> contents)  
      protected boolean isFileInList​(org.alfresco.utility.model.FileModel fileModel, java.util.List<org.alfresco.utility.model.FileModel> files)  
      protected boolean isFolderInList​(org.alfresco.utility.model.FolderModel folderModel, java.util.List<org.alfresco.utility.model.FolderModel> folders)  
      java.io.File setNewFile​(org.alfresco.utility.model.FileModel fileModel)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FTPUtil

        public FTPUtil​(FTPWrapper ftpWrapper)
    • Method Detail

      • getContent

        public java.lang.String getContent​(java.lang.String filePath)
                                    throws java.io.IOException
        Return the content of
        Parameters:
        filePath -
        Returns:
        Throws:
        java.io.IOException
      • contentExists

        public boolean contentExists()
                              throws java.lang.Exception
        Verify 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.Exception
        Get 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.Exception
        Get 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.Exception
        Get 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.Exception
        Get file size. Return 0 if resource is a folder
        Returns:
        file size
        Throws:
        java.lang.Exception
      • getReplyCode

        protected int getReplyCode()