Class NetUtils

java.lang.Object
ubic.basecode.util.NetUtils

public class NetUtils extends Object
Author:
pavlidis
  • Constructor Details

    • NetUtils

      public NetUtils()
  • Method Details

    • 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.
    • connect

      public static org.apache.commons.net.ftp.FTPClient connect(int mode, String host, String loginName, String password) throws SocketException, IOException
      Convenient method to get a FTP connection.
      Parameters:
      mode -
      host -
      password -
      login -
      Returns:
      Throws:
      SocketException
      IOException
    • 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
    • ftpDownloadFile

      public static boolean ftpDownloadFile(org.apache.commons.net.ftp.FTPClient f, String seekFile, String outputFileName, boolean force) throws IOException, FileNotFoundException
      Parameters:
      f -
      seekFile -
      outputFileName -
      force -
      Returns:
      boolean indicating success or failure.
      Throws:
      IOException
      FileNotFoundException
    • 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