Class NetUtils


  • public class NetUtils
    extends Object
    Author:
    pavlidis
    • Constructor Detail

      • NetUtils

        public NetUtils()
    • Method Detail

      • checkForFile

        public static long checkForFile​(org.apache.commons.net.ftp.FTPClient f,
                                        String seekFile)
                                 throws IOException
        determine if a file exists on the remote server.
        Parameters:
        f -
        seekFile -
        Returns:
        the size of the file
        Throws:
        FileNotFoundException - if the file does not exist.
        IOException - on other IO errors.
      • ftpDownloadFile

        public static boolean ftpDownloadFile​(org.apache.commons.net.ftp.FTPClient f,
                                              String seekFile,
                                              File outputFile,
                                              boolean force)
                                       throws IOException
        Parameters:
        f -
        seekFile -
        outputFile -
        force -
        Returns:
        boolean indicating success or failure.
        Throws:
        IOException
      • ftpFileSize

        public static long ftpFileSize​(org.apache.commons.net.ftp.FTPClient f,
                                       String seekFile)
                                throws IOException
        Get the size of a remote file.
        Parameters:
        f - FTPClient
        seekFile -
        Returns:
        Throws:
        IOException