Package ubic.basecode.util
Class NetUtils
- java.lang.Object
-
- ubic.basecode.util.NetUtils
-
public class NetUtils extends Object
- Author:
- pavlidis
-
-
Constructor Summary
Constructors Constructor Description NetUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static longcheckForFile(org.apache.commons.net.ftp.FTPClient f, String seekFile)determine if a file exists on the remote server.static org.apache.commons.net.ftp.FTPClientconnect(int mode, String host, String loginName, String password)Convenient method to get a FTP connection.static booleanftpDownloadFile(org.apache.commons.net.ftp.FTPClient f, String seekFile, File outputFile, boolean force)static booleanftpDownloadFile(org.apache.commons.net.ftp.FTPClient f, String seekFile, String outputFileName, boolean force)static longftpFileSize(org.apache.commons.net.ftp.FTPClient f, String seekFile)Get the size of a remote file.
-
-
-
Method Detail
-
checkForFile
public static long checkForFile(org.apache.commons.net.ftp.FTPClient f, String seekFile) throws IOExceptiondetermine 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, IOExceptionConvenient method to get a FTP connection.- Parameters:
host-login-password-mode-- Returns:
- Throws:
SocketExceptionIOException
-
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:
IOExceptionFileNotFoundException
-
ftpFileSize
public static long ftpFileSize(org.apache.commons.net.ftp.FTPClient f, String seekFile) throws IOExceptionGet the size of a remote file.- Parameters:
f- FTPClientseekFile-- Returns:
- Throws:
IOException
-
-