Class TransfertStaticToZip

  • All Implemented Interfaces:
    Runnable

    public class TransfertStaticToZip
    extends Thread
    • Field Detail

      • running

        public boolean running
    • Method Detail

      • getFolder

        public File getFolder()
      • setFolder

        public void setFolder​(File folder)
      • getUrl

        public URL getUrl()
      • setUrl

        public void setUrl​(URL url)
      • getPath

        public String getPath()
      • setPath

        public void setPath​(String path)
      • uploadSingleFile

        public static boolean uploadSingleFile​(org.apache.commons.net.ftp.FTPClient ftpClient,
                                               String localFilePath,
                                               String remoteFilePath)
                                        throws IOException
        Upload a single file to the FTP server.
        Parameters:
        ftpClient - an instance of org.apache.commons.net.ftp.FTPClient class.
        localFilePath - Path of the file on local computer
        remoteFilePath - Path of the file on remote the server
        Returns:
        true if the file was uploaded successfully, false otherwise
        Throws:
        IOException - if any network or IO error occurred.
      • uploadDirectory

        public static void uploadDirectory​(org.apache.commons.net.ftp.FTPClient ftpClient,
                                           String remoteDirPath,
                                           File localDir,
                                           String remoteParentDir)
                                    throws IOException
        Upload a whole directory (including its nested sub directories and files) to a FTP server.
        Parameters:
        ftpClient - an instance of org.apache.commons.net.ftp.FTPClient class.
        remoteDirPath - Path of the destination directory on the server.
        localParentDir - Path of the local directory being uploaded.
        remoteParentDir - Path of the parent directory of the current directory on the server (used by recursive calls).
        Throws:
        IOException - if any network or IO error occurred.
      • run

        public void run()
        Specified by:
        run in interface Runnable
        Overrides:
        run in class Thread