public class NXFtpClient extends FtpClient implements NXSocketClient
| Constructor and Description |
|---|
NXFtpClient() |
NXFtpClient(NXLog log,
java.net.Proxy proxy) |
| Modifier and Type | Method and Description |
|---|---|
void |
cdUp() |
void |
changeFolder(java.lang.String dir) |
void |
connect()
Connects to the server with the credentials set by calling SetCredentials.
|
void |
createDirectory(java.lang.String dir) |
void |
delete(java.lang.String file) |
void |
deleteDirectory(java.lang.String dir) |
void |
disconnect() |
void |
fakeDirectory(NXObjectIndex oi,
java.lang.String path)
Make a fake directory listing from NXObjectIndex given for path.
|
byte[] |
get(java.lang.String remoteFile,
java.lang.String localFile,
boolean preview,
NXProgressUpdateRunnable callBack)
Downloads a remote file.
|
boolean |
getBinary() |
java.lang.String[] |
getCredentials() |
java.lang.String |
getCurrDir() |
java.util.HashMap |
getObjectIndex() |
java.lang.String |
getWelcome() |
int |
indexDirectory(java.lang.String dir) |
boolean |
isDirectory(java.lang.String dir)
Check if dir is a directory.
|
void |
put(java.lang.String localFile,
java.lang.String remoteFile,
NXProgressUpdateRunnable callBack) |
void |
renameImpl(java.lang.String oldFile,
java.lang.String newFile) |
void |
setCredentials(java.lang.String[] argv)
Sets the credentials for the session.
|
void |
stopCurrent() |
public NXFtpClient()
public NXFtpClient(NXLog log, java.net.Proxy proxy)
public java.lang.String getCurrDir()
getCurrDir in interface NXSocketClientpublic boolean getBinary()
public void setCredentials(java.lang.String[] argv)
setCredentials in interface NXSocketClientargv - An array of strings containing:
0: Server's hostname
1: Username
2: Passwordpublic java.lang.String[] getCredentials()
getCredentials in interface NXSocketClientpublic void connect()
throws java.net.SocketException,
sun.net.ftp.FtpLoginException,
sun.net.ftp.FtpProtocolException,
java.net.UnknownHostException,
java.io.IOException
connect in interface NXSocketClientjava.net.SocketExceptionsun.net.ftp.FtpLoginExceptionsun.net.ftp.FtpProtocolExceptionjava.net.UnknownHostExceptionjava.io.IOExceptionpublic int indexDirectory(java.lang.String dir)
throws java.net.SocketException,
sun.net.ftp.FtpProtocolException,
java.io.IOException
indexDirectory in interface NXSocketClientjava.net.SocketExceptionsun.net.ftp.FtpProtocolExceptionjava.io.IOExceptionpublic void fakeDirectory(NXObjectIndex oi, java.lang.String path)
fakeDirectory in interface NXSocketClientpublic boolean isDirectory(java.lang.String dir)
isDirectory in interface NXSocketClientpublic java.util.HashMap getObjectIndex()
getObjectIndex in interface NXSocketClientpublic void createDirectory(java.lang.String dir)
throws java.io.IOException
createDirectory in interface NXSocketClientjava.io.IOExceptionpublic void deleteDirectory(java.lang.String dir)
throws java.io.IOException,
sun.net.ftp.FtpProtocolException
deleteDirectory in interface NXSocketClientjava.io.IOExceptionsun.net.ftp.FtpProtocolExceptionpublic void delete(java.lang.String file)
throws java.io.IOException,
sun.net.ftp.FtpProtocolException
delete in interface NXSocketClientjava.io.IOExceptionsun.net.ftp.FtpProtocolExceptionpublic byte[] get(java.lang.String remoteFile,
java.lang.String localFile,
boolean preview,
NXProgressUpdateRunnable callBack)
throws java.io.IOException,
sun.net.ftp.FtpProtocolException
get in interface NXSocketClientremoteFile - The remote file.localFile - The local file.preview - If true, then downloads to byte array and then returns it.callBack - Calls to update progress.java.io.IOExceptionsun.net.ftp.FtpProtocolExceptionpublic void put(java.lang.String localFile,
java.lang.String remoteFile,
NXProgressUpdateRunnable callBack)
throws java.io.IOException,
sun.net.ftp.FtpProtocolException
put in interface NXSocketClientjava.io.IOExceptionsun.net.ftp.FtpProtocolExceptionpublic void disconnect()
disconnect in interface NXSocketClientpublic void changeFolder(java.lang.String dir)
throws java.lang.Exception
changeFolder in interface NXSocketClientjava.lang.Exceptionpublic void stopCurrent()
stopCurrent in interface NXSocketClientpublic java.lang.String getWelcome()
getWelcome in interface NXSocketClientpublic void cdUp()
throws java.io.IOException
cdUp in interface NXSocketClientjava.io.IOExceptionpublic void renameImpl(java.lang.String oldFile,
java.lang.String newFile)
throws java.io.IOException,
sun.net.ftp.FtpProtocolException
renameImpl in interface NXSocketClientjava.io.IOExceptionsun.net.ftp.FtpProtocolException