Package com.ibm.di.fc.filetransferfc
Class FileTransferOperator
- java.lang.Object
-
- com.ibm.di.fc.filetransferfc.FileTransferOperator
-
public class FileTransferOperator extends java.lang.ObjectThe File Transfer Operator that connects and Transfer Files to a target machine
-
-
Constructor Summary
Constructors Constructor Description FileTransferOperator(java.util.Properties p, Log log)Constructor for the FileTransferAgent
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Closes the connection to the targetvoidcreateDirectory(java.lang.String dir)Create a directory on the target machinejava.util.Vector<java.lang.String>getProtocolList()Iterates through all the protocols and tries to make a connection using each of them with the specified configurationbooleanisExists(java.lang.String filePath)Checks the given file exists or not on remote machinejava.lang.String[]list(java.lang.String path)Checks the given file exists or not on remote machinebooleanprepareConnection()Creates a connection with the target machinevoidprintDebugMessage(java.lang.String msgKey, java.lang.Object[] params)Prints a debug message if debug mode for the Components is enabled.voidreceiveFile(java.lang.String source, java.lang.String target)Receives a file from target to sourcevoidtransferFile(java.lang.String source, java.lang.String target)Transfers file from source to target
-
-
-
Constructor Detail
-
FileTransferOperator
public FileTransferOperator(java.util.Properties p, Log log)Constructor for the FileTransferAgent- Parameters:
lp- The LogProxy for loggingp- The configuration properties for the initialization of the connection
-
-
Method Detail
-
prepareConnection
public boolean prepareConnection() throws RemoteConnectException, ParamException, java.lang.ExceptionCreates a connection with the target machine- Returns:
- boolean value representing the success of the connection
- Throws:
RemoteConnectExceptionParamExceptionjava.lang.Exception
-
transferFile
public void transferFile(java.lang.String source, java.lang.String target) throws java.lang.ExceptionTransfers file from source to target- Parameters:
source- Path to source filetarget- Path to destination file on target machine- Throws:
java.lang.Exception- If file transfer is unsuccessful
-
receiveFile
public void receiveFile(java.lang.String source, java.lang.String target) throws java.lang.ExceptionReceives a file from target to source- Parameters:
source- Path to source filetarget- Path to destination file on local machine- Throws:
java.lang.Exception- If file transfer is unsuccessful
-
createDirectory
public void createDirectory(java.lang.String dir) throws java.lang.ExceptionCreate a directory on the target machine- Parameters:
dir- Path of the folder to be created- Throws:
java.lang.Exception- If the directory creation is not successful.
-
isExists
public boolean isExists(java.lang.String filePath) throws java.lang.ExceptionChecks the given file exists or not on remote machine- Parameters:
filePath- Path of the file- Returns:
- true if the given file exists on remote machine otherwise false
- Throws:
java.lang.Exception
-
list
public java.lang.String[] list(java.lang.String path) throws java.lang.ExceptionChecks the given file exists or not on remote machine- Parameters:
path- Path of the file- Returns:
- true if the given file exists on remote machine otherwise false
- Throws:
java.lang.Exception
-
close
public void close()
Closes the connection to the target
-
getProtocolList
public java.util.Vector<java.lang.String> getProtocolList()
Iterates through all the protocols and tries to make a connection using each of them with the specified configuration- Returns:
- String array of the protocols through which a successful connection could be made.
-
printDebugMessage
public void printDebugMessage(java.lang.String msgKey, java.lang.Object[] params)Prints a debug message if debug mode for the Components is enabled.- Parameters:
msgKey- message keyparams- place holder for debug messages
-
-