📄 filetransferclientinterface.java
字号:
* @throws FTPException, IOException
*/
public String[] directoryNameList(String directoryName, boolean isLongListing)
throws FTPException, IOException;
/**
* List the current directory on the FTP server.
*
* @throws FTPException, IOException
* @throws ParseException
*/
public FTPFile[] directoryList()
throws FTPException, IOException, ParseException;
/**
* List a directory on the FTP server.
*
* @param directoryName name of the directory (generally not a path). Some
* servers will accept a wildcard.
* @throws FTPException, IOException
* @throws ParseException
*/
public FTPFile[] directoryList(String directoryName)
throws FTPException, IOException, ParseException;
/**
* Download a file from the FTP server into a byte array.
*
* @param remoteFileName name of the remote file to be downloaded
* @throws FTPException
*/
public byte[] downloadByteArray(String remoteFileName)
throws FTPException, IOException;
/**
* Download a file from the FTP server .
*
* @param localFileName name (or full path) of the local file to be downloaded to
* @param remoteFileName name of the remote file to be downloaded
* @throws FTPException
*/
public void downloadFile(String localFileName, String remoteFileName)
throws FTPException, IOException;
/**
* Download a file from the FTP server .
*
* @param localFileName name (or full path) of the local file to be downloaded to
* @param remoteFileName name of the remote file to be downloaded
* @param writeMode mode in which the file is written to the client machine
* @throws FTPException
*/
public void downloadFile(String localFileName, String remoteFileName,
WriteMode writeMode)
throws FTPException, IOException;
/**
* Download a file from the FTP server as a stream. The close() method <b>must</b>
* be called on the stream once the stream has been read.
*
* @param remoteFileName name of the remote file to be downloaded
* @return InputStream
* @throws FTPException
*/
public FileTransferInputStream downloadStream(String remoteFileName)
throws FTPException, IOException;
/**
* Upload a file to the FTP server. If a null is supplied as
* the remoteFileName, the STOU (store unique) FTP feature will be used (if
* available) and the FTP server will generate a unique name for the file.
*
* @param localFileName
* name (or full path) of the local file to be downloaded to
* @param remoteFileName
* name of the remote file to be downloaded (or null to generate a unique name)
* @return name of remote file
* @throws FTPException
*/
public String uploadFile(String localFileName, String remoteFileName)
throws FTPException, IOException;
/**
* Upload a file to the FTP server. If a null is supplied as
* the remoteFileName, the STOU (store unique) FTP feature will be used (if
* available) and the FTP server will generate a unique name for the file.
*
* @param localFileName
* name (or full path) of the local file to be downloaded to
* @param remoteFileName
* name of the remote file to be downloaded (or null to generate a unique name)
* @param writeMode mode to write to the remote file with
* @return name of remote file
* @throws FTPException
*/
public String uploadFile(String localFileName, String remoteFileName, WriteMode writeMode)
throws FTPException, IOException;
/**
* Upload a file to the FTP server by writing to a stream. The close() method <b>must</b>
* be called on the stream once the stream has been read.
* If a null is supplied as
* the remoteFileName, the STOU (store unique) FTP feature will be used (if
* available) and the FTP server will generate a unique name for the file. This
* name can be obtained afterwards from {@see FileTransferOutputStream#getRemoteFile()}
*
* @param remoteFileName name of the remote file to be uploaded
* @return FTPOutputStream
* @throws FTPException
* @throws IOException
*/
public FileTransferOutputStream uploadStream(String remoteFileName)
throws FTPException, IOException;
/**
* Upload a file to the FTP server by writing to a stream. The close() method *must*
* be called on the stream once the stream has been read.
* If a null is supplied as
* the remoteFileName, the STOU (store unique) FTP feature will be used (if
* available) and the FTP server will generate a unique name for the file. This
* name can be obtained afterwards from {@see FileTransferOutputStream#getRemoteFile()}
*
* @param remoteFileName name of the remote file to be uploaded
* @param writeMode mode for writing to the server (supporting use of append)
* @return FTPOutputStream
* @throws FTPException
* @throws IOException
*/
public FileTransferOutputStream uploadStream(String remoteFileName, WriteMode writeMode)
throws FTPException, IOException;
/**
* Get the size of a remote file.
*
* @param remoteFileName name of remote file
* @return long
* @throws FTPException
*/
public long getSize(String remoteFileName)
throws FTPException,IOException;
/**
* Get the modified-time of a remote file. May not be supported by
* all servers.
*
* @param remoteFileName name of remote file
* @return Date
* @throws FTPException
*/
public Date getModifiedTime(String remoteFileName) throws FTPException, IOException;
/**
* Set the modified-time of a remote file. May not be supported by
* all servers.
*
* @param remoteFileName name of remote file
* @param modifiedTime new modified time
* @throws FTPException
*/
public void setModifiedTime(String remoteFileName, Date modifiedTime)
throws FTPException, IOException;
/**
* Determine if a remote file exists.
*
* @param remoteFileName name of remote file
* @throws FTPException
*/
public boolean exists(String remoteFileName)
throws FTPException, IOException;
/**
* Deletes a remote file.
*
* @param remoteFileName name of remote file
* @throws FTPException
* @throws IOException
*/
public void deleteFile(String remoteFileName)
throws FTPException, IOException;
/**
* Rename a remote file or directory.
*
* @param renameFromName
* original name
* @param renameToName
* new name
* @throws FTPException, IOException
*/
public void rename(String renameFromName, String renameToName)
throws FTPException, IOException;
/**
* Change directory on the FTP server.
*
* @param directoryName
* name the remote directory to change into
* @throws FTPException, IOException
*/
public void changeDirectory(String directoryName) throws FTPException, IOException;
/**
* Change to parent directory on the FTP server.
*
* @throws FTPException, IOException
*/
public void changeToParentDirectory() throws FTPException, IOException;
/**
* Get the current remote directory.
*
* @return current remote directory
* @throws FTPException
* @throws IOException
*/
public String getRemoteDirectory() throws IOException, FTPException;
/**
* Create directory on the FTP server.
*
* @param directoryName
* name the remote directory to create
* @throws FTPException, IOException
*/
public void createDirectory(String directoryName) throws FTPException, IOException;
/**
* Create directory on the FTP server. The directory must be empty. Note
* that edtFTPj/PRO supports recursive directory deletions.
*
* @param directoryName
* name the remote directory to create
* @throws FTPException, IOException
*/
public void deleteDirectory(String directoryName)
throws FTPException, IOException;
/**
* Disconnect from the FTP server.
*
* @throws FTPException, IOException
*/
public void disconnect()
throws FTPException, IOException;
/**
* Disconnect from the FTP server.
*
* @throws FTPException, IOException
*/
public void disconnect(boolean immediate)
throws FTPException, IOException;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -