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 long
checkForFile(org.apache.commons.net.ftp.FTPClient f, String seekFile)
determine if a file exists on the remote server.static org.apache.commons.net.ftp.FTPClient
connect(int mode, String host, String loginName, String password)
Convenient method to get a FTP connection.static boolean
ftpDownloadFile(org.apache.commons.net.ftp.FTPClient f, String seekFile, File outputFile, boolean force)
static boolean
ftpDownloadFile(org.apache.commons.net.ftp.FTPClient f, String seekFile, String outputFileName, boolean force)
static long
ftpFileSize(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 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:
host
-login
-password
-mode
-- 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
- FTPClientseekFile
-- Returns:
- Throws:
IOException
-
-