Package org.apache.ofbiz.content.ftp
Class SimpleFtpClient
java.lang.Object
org.apache.ofbiz.content.ftp.SimpleFtpClient
- All Implemented Interfaces:
FtpClientInterface
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Close opened connectionvoid
Initialization of a file transfer client, and connection to the given servervoid
copy
(String path, String fileName, InputStream file) Copy of the give file to the connected server into the path.void
setBinaryTransfer
(boolean isBinary) void
setPassiveMode
(boolean isPassive)
-
Constructor Details
-
SimpleFtpClient
public SimpleFtpClient()
-
-
Method Details
-
connect
public void connect(String hostname, String username, String password, Long port, Long timeout) throws IOException, GeneralException Description copied from interface:FtpClientInterface
Initialization of a file transfer client, and connection to the given server- Specified by:
connect
in interfaceFtpClientInterface
- Parameters:
hostname
- hostname to connect tousername
- username to login withpassword
- password to login withport
- port to connect to the server, optionaltimeout
- timeout for connection process, optional- Throws:
IOException
GeneralException
-
list
- Specified by:
list
in interfaceFtpClientInterface
- Throws:
IOException
-
setBinaryTransfer
- Specified by:
setBinaryTransfer
in interfaceFtpClientInterface
- Throws:
IOException
-
setPassiveMode
public void setPassiveMode(boolean isPassive) - Specified by:
setPassiveMode
in interfaceFtpClientInterface
-
copy
Description copied from interface:FtpClientInterface
Copy of the give file to the connected server into the path.- Specified by:
copy
in interfaceFtpClientInterface
- Parameters:
path
- path to copy the file tofileName
- name of the copied filefile
- data to copy- Throws:
IOException
-
closeConnection
Description copied from interface:FtpClientInterface
Close opened connection- Specified by:
closeConnection
in interfaceFtpClientInterface
- Throws:
IOException
-