Package org.apache.ofbiz.content.ftp
Class SshFtpClient
java.lang.Object
org.apache.ofbiz.content.ftp.SshFtpClient
- All Implemented Interfaces:
FtpClientInterface
Basic client to copy files to an ssh ftp server
-
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
-
SshFtpClient
public SshFtpClient()
-
-
Method Details
-
connect
public void connect(String hostname, String username, String password, Long port, Long timeout) throws IOException 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
-
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
-
list
- Specified by:
list
in interfaceFtpClientInterface
- Throws:
IOException
-
setBinaryTransfer
- Specified by:
setBinaryTransfer
in interfaceFtpClientInterface
- Throws:
IOException
-
setPassiveMode
- Specified by:
setPassiveMode
in interfaceFtpClientInterface
- Throws:
IOException
-
closeConnection
Description copied from interface:FtpClientInterface
Close opened connection- Specified by:
closeConnection
in interfaceFtpClientInterface
- Throws:
IOException
-