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 NXSocketClient
public boolean getBinary()
public void setCredentials(java.lang.String[] argv)
setCredentials
in interface NXSocketClient
argv
- An array of strings containing:
0: Server's hostname
1: Username
2: Passwordpublic java.lang.String[] getCredentials()
getCredentials
in interface NXSocketClient
public void connect() throws java.net.SocketException, sun.net.ftp.FtpLoginException, sun.net.ftp.FtpProtocolException, java.net.UnknownHostException, java.io.IOException
connect
in interface NXSocketClient
java.net.SocketException
sun.net.ftp.FtpLoginException
sun.net.ftp.FtpProtocolException
java.net.UnknownHostException
java.io.IOException
public int indexDirectory(java.lang.String dir) throws java.net.SocketException, sun.net.ftp.FtpProtocolException, java.io.IOException
indexDirectory
in interface NXSocketClient
java.net.SocketException
sun.net.ftp.FtpProtocolException
java.io.IOException
public void fakeDirectory(NXObjectIndex oi, java.lang.String path)
fakeDirectory
in interface NXSocketClient
public boolean isDirectory(java.lang.String dir)
isDirectory
in interface NXSocketClient
public java.util.HashMap getObjectIndex()
getObjectIndex
in interface NXSocketClient
public void createDirectory(java.lang.String dir) throws java.io.IOException
createDirectory
in interface NXSocketClient
java.io.IOException
public void deleteDirectory(java.lang.String dir) throws java.io.IOException, sun.net.ftp.FtpProtocolException
deleteDirectory
in interface NXSocketClient
java.io.IOException
sun.net.ftp.FtpProtocolException
public void delete(java.lang.String file) throws java.io.IOException, sun.net.ftp.FtpProtocolException
delete
in interface NXSocketClient
java.io.IOException
sun.net.ftp.FtpProtocolException
public 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 NXSocketClient
remoteFile
- 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.IOException
sun.net.ftp.FtpProtocolException
public void put(java.lang.String localFile, java.lang.String remoteFile, NXProgressUpdateRunnable callBack) throws java.io.IOException, sun.net.ftp.FtpProtocolException
put
in interface NXSocketClient
java.io.IOException
sun.net.ftp.FtpProtocolException
public void disconnect()
disconnect
in interface NXSocketClient
public void changeFolder(java.lang.String dir) throws java.lang.Exception
changeFolder
in interface NXSocketClient
java.lang.Exception
public void stopCurrent()
stopCurrent
in interface NXSocketClient
public java.lang.String getWelcome()
getWelcome
in interface NXSocketClient
public void cdUp() throws java.io.IOException
cdUp
in interface NXSocketClient
java.io.IOException
public void renameImpl(java.lang.String oldFile, java.lang.String newFile) throws java.io.IOException, sun.net.ftp.FtpProtocolException
renameImpl
in interface NXSocketClient
java.io.IOException
sun.net.ftp.FtpProtocolException