Interface FileTransferClient
-
- All Superinterfaces:
org.ikasan.connector.base.command.TransactionalResource
public interface FileTransferClient extends org.ikasan.connector.base.command.TransactionalResourceAn interface for various File Transfer Clients to implement- Author:
- Ikasan Development Team
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidcd(java.lang.String targetPath)Method to change directoryvoiddeleteRemoteDirectory(java.lang.String directoryPath, boolean recurse)Method to delete a remote directoryvoiddeleteRemoteFile(java.lang.String filename)Method to delete a remote filevoiddisconnect()TODO add commentBaseFileTransferMappedRecordget(java.lang.String filePath)Gets a BaseFileTransferMappedRecord (a 'File') given a filePathvoidget(java.lang.String filePath, java.io.OutputStream outputStream)Get a file as a OutputStreamvoidget(java.lang.String filePath, java.io.OutputStream outputStream, int resume, long offset)Get a file as an OutputStream given an offset and a resume flagBaseFileTransferMappedRecordget(ClientListEntry clientListEntry)Gets a BaseFileTransferMappedRecord (a 'File') given a ClientListEntryjava.io.InputStreamgetAsInputStream(java.lang.String filePath)Utilises the underlying API to return an InputStream as the result of the GET operationjava.io.InputStreamgetContentAsStream(ClientListEntry entry)Get the content of a ClientListFileEntry (a 'File') as an InputStreamjava.util.List<ClientListEntry>ls(java.lang.String path)Method to return a list of the contents of a directoryvoidmkdir(java.lang.String directory)Allow the creation of directories.voidput(java.lang.String name, byte[] content)Method to put a content on to a File Tansfer systemvoidputWithOutputStream(java.lang.String fileName, java.io.InputStream inputstream)Method to put the file using an OutputStreamjava.lang.Stringpwd()Method to list what directory you are currently invoidrename(java.lang.String currentPath, java.lang.String newPath)Method to rename a path (a 'File')
-
-
-
Method Detail
-
cd
void cd(java.lang.String targetPath) throws ClientCommandCdException
Method to change directory- Parameters:
targetPath-- Throws:
ClientCommandCdException
-
deleteRemoteDirectory
void deleteRemoteDirectory(java.lang.String directoryPath, boolean recurse) throws ClientException, ClientCommandLsExceptionMethod to delete a remote directory- Parameters:
directoryPath-recurse- (whether to delete recursively or not)- Throws:
ClientExceptionClientCommandLsException
-
deleteRemoteFile
void deleteRemoteFile(java.lang.String filename) throws ClientExceptionMethod to delete a remote file- Parameters:
filename-- Throws:
ClientException
-
get
BaseFileTransferMappedRecord get(ClientListEntry clientListEntry) throws ClientCommandGetException
Gets a BaseFileTransferMappedRecord (a 'File') given a ClientListEntry- Parameters:
clientListEntry-- Returns:
- BaseFileTransferMappedRecord (a 'File')
- Throws:
ClientCommandGetException
-
get
BaseFileTransferMappedRecord get(java.lang.String filePath) throws ClientCommandGetException
Gets a BaseFileTransferMappedRecord (a 'File') given a filePath- Parameters:
filePath-- Returns:
- BaseFileTransferMappedRecord (a 'File')
- Throws:
ClientCommandGetException
-
get
void get(java.lang.String filePath, java.io.OutputStream outputStream) throws ClientCommandGetExceptionGet a file as a OutputStream- Parameters:
filePath-outputStream-- Throws:
ClientCommandGetException
-
get
void get(java.lang.String filePath, java.io.OutputStream outputStream, int resume, long offset) throws ClientCommandGetExceptionGet a file as an OutputStream given an offset and a resume flag- Parameters:
filePath-outputStream-resume-offset-- Throws:
ClientCommandGetException
-
getAsInputStream
java.io.InputStream getAsInputStream(java.lang.String filePath) throws ClientCommandGetExceptionUtilises the underlying API to return an InputStream as the result of the GET operation- Parameters:
filePath-- Returns:
- InputStream
- Throws:
ClientCommandGetException
-
getContentAsStream
java.io.InputStream getContentAsStream(ClientListEntry entry) throws ClientCommandGetException
Get the content of a ClientListFileEntry (a 'File') as an InputStream- Parameters:
entry-- Returns:
- InputStream
- Throws:
ClientCommandGetException
-
ls
java.util.List<ClientListEntry> ls(java.lang.String path) throws ClientCommandLsException, java.net.URISyntaxException
Method to return a list of the contents of a directory- Parameters:
path-- Returns:
- A list of ClientListEntries
- Throws:
ClientCommandLsExceptionjava.net.URISyntaxException
-
put
void put(java.lang.String name, byte[] content) throws ClientCommandPutExceptionMethod to put a content on to a File Tansfer system- Parameters:
name- (of the 'File')content- (of the 'File')- Throws:
ClientCommandPutException
-
putWithOutputStream
void putWithOutputStream(java.lang.String fileName, java.io.InputStream inputstream) throws ClientCommandPutException, ClientCommandLsException, ClientCommandMkdirExceptionMethod to put the file using an OutputStream- Parameters:
fileName-inputstream-- Throws:
ClientCommandPutExceptionClientCommandLsExceptionClientCommandMkdirException
-
pwd
java.lang.String pwd() throws ClientCommandPwdExceptionMethod to list what directory you are currently in- Returns:
- Fully qualified path to what directory you are in.
- Throws:
ClientCommandPwdException
-
rename
void rename(java.lang.String currentPath, java.lang.String newPath) throws ClientCommandRenameExceptionMethod to rename a path (a 'File')- Parameters:
currentPath-newPath-- Throws:
ClientCommandRenameException
-
disconnect
void disconnect()
TODO add comment
-
mkdir
void mkdir(java.lang.String directory) throws ClientCommandMkdirExceptionAllow the creation of directories.- Parameters:
directory-- Throws:
ClientCommandMkdirException
-
-