public abstract class FileTransferClientImp extends java.lang.Object implements FileTransferClient
Modifier and Type | Field and Description |
---|---|
protected org.slf4j.Logger |
logR |
Constructor and Description |
---|
FileTransferClientImp() |
Modifier and Type | Method and Description |
---|---|
java.lang.String[] |
dir()
List current directory's contents as an array of strings of filenames.
|
java.lang.String[] |
dir(java.lang.String dirname)
List a directory's contents as an array of strings of filenames.
|
java.lang.String[] |
dir(java.lang.String directory,
java.io.FileFilter filter)
List a directory's contents
|
java.lang.String[] |
dir(java.lang.String directory,
java.io.FilenameFilter filter)
List a directory's contents
|
void |
get(java.lang.String localPath,
java.lang.String remoteFile)
Get data from the FTP server.
|
protected boolean |
isAdditionaDebug() |
protected void |
log(java.lang.String msg,
java.lang.Object... params) |
void |
put(byte[] bytes,
java.lang.String remoteFile)
Put data onto the FTP server.
|
void |
put(byte[] bytes,
java.lang.String remoteFile,
boolean append)
Put data onto the FTP server.
|
void |
put(java.io.InputStream srcStream,
java.lang.String remoteFile)
Put a stream of data onto the FTP server.
|
void |
put(java.lang.String localPath,
java.lang.String remoteFile)
Put a local file onto the FTP server.
|
void |
put(java.lang.String localPath,
java.lang.String remoteFile,
boolean append)
Put a local file onto the FTP server.
|
void |
setAdditionalDebug(boolean on)
Switch additional debug on or off
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
chdir, close, connect, delete, dir, disconnect, get, get, getKeepAliveTimeout, isConnected, lastModified, lastModifiedDate, mkdir, put, rename, rmdir, setKeepAliveTimeout
public void put(java.lang.String localPath, java.lang.String remoteFile) throws java.io.IOException, FileTransferException
FileTransferClient
put
in interface FileTransferClient
localPath
- path of the local fileremoteFile
- name of remote file in current directoryFileTransferException
- if an FTP specific exception occursjava.io.IOException
- if a comms error occursFileTransferClient.put(java.lang.String,
java.lang.String)
public void put(java.lang.String localPath, java.lang.String remoteFile, boolean append) throws java.io.IOException, FileTransferException
FileTransferClient
put
in interface FileTransferClient
localPath
- path of the local fileremoteFile
- name of remote fileappend
- true if appending, false otherwiseFileTransferException
- if an FTP specific exception occursjava.io.IOException
- if a comms error occursFileTransferClient.put(java.lang.String, java.lang.String, boolean)
public void put(byte[] bytes, java.lang.String remoteFile, boolean append) throws java.io.IOException, FileTransferException
FileTransferClient
put
in interface FileTransferClient
bytes
- array of bytesremoteFile
- name of remote fileappend
- true if appending, false otherwiseFileTransferException
- if an FTP specific exception occursjava.io.IOException
- if a comms error occursFileTransferClient.put(byte[], java.lang.String, boolean)
public void put(java.io.InputStream srcStream, java.lang.String remoteFile) throws java.io.IOException, FileTransferException
FileTransferClient
put
in interface FileTransferClient
srcStream
- input stream of data to putremoteFile
- name of remote fileFileTransferException
- if an FTP specific exception occursjava.io.IOException
- if a comms error occursFileTransferClient.put(java.io.InputStream,
java.lang.String)
public void put(byte[] bytes, java.lang.String remoteFile) throws java.io.IOException, FileTransferException
FileTransferClient
put
in interface FileTransferClient
bytes
- array of bytesremoteFile
- name of remote fileFileTransferException
- if an FTP specific exception occursjava.io.IOException
- if a comms error occursFileTransferClient.put(byte[],
java.lang.String)
public java.lang.String[] dir() throws java.io.IOException, FileTransferException
FileTransferClient
dir
in interface FileTransferClient
FileTransferException
- if an FTP specific exception occursjava.io.IOException
- if a comms error occursFileTransferClient.dir()
public java.lang.String[] dir(java.lang.String dirname) throws java.io.IOException, FileTransferException
FileTransferClient
dir
in interface FileTransferClient
dirname
- name of directory(not a file mask)FileTransferException
- if an FTP specific exception occursjava.io.IOException
- if a comms error occursFileTransferClient.dir(java.lang.String)
public java.lang.String[] dir(java.lang.String directory, java.io.FileFilter filter) throws FileTransferException, java.io.IOException
FileTransferClient
dir
in interface FileTransferClient
directory
- the directory to list.filter
- the filefilter mask to useFileTransferException
- on FTP Specific exception error.java.io.IOException
- on comms error.FileTransferClient.dir(java.lang.String, java.io.FileFilter)
public java.lang.String[] dir(java.lang.String directory, java.io.FilenameFilter filter) throws FileTransferException, java.io.IOException
FileTransferClient
dir
in interface FileTransferClient
directory
- the directory to list.filter
- the filefilter mask to useFileTransferException
- on FTP Specific exception error.java.io.IOException
- on comms error.FileTransferClient.dir(java.lang.String, java.io.FilenameFilter)
public void get(java.lang.String localPath, java.lang.String remoteFile) throws java.io.IOException, FileTransferException
FileTransferClient
get
in interface FileTransferClient
localPath
- local file to put data inremoteFile
- name of remote fileFileTransferException
- if an FTP specific exception occursjava.io.IOException
- if a comms error occursFileTransferClient.get(java.lang.String, java.lang.String)
public void setAdditionalDebug(boolean on)
FileTransferClient
setAdditionalDebug
in interface FileTransferClient
on
- set to true if you wish to get some additional debugging in the log file, defaults to
falseprotected boolean isAdditionaDebug()
protected void log(java.lang.String msg, java.lang.Object... params)