Package org.apache.ofbiz.content.ftp
Class SshFtpClient
- java.lang.Object
-
- org.apache.ofbiz.content.ftp.SshFtpClient
-
- All Implemented Interfaces:
FtpClientInterface
public class SshFtpClient extends java.lang.Object implements FtpClientInterface
Basic client to copy files to an ssh ftp server
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
module
-
Constructor Summary
Constructors Constructor Description SshFtpClient()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
closeConnection()
Close opened connectionvoid
connect(java.lang.String hostname, java.lang.String username, java.lang.String password, java.lang.Long port, java.lang.Long timeout)
Initialization of a file transfer client, and connection to the given servervoid
copy(java.lang.String path, java.lang.String fileName, java.io.InputStream file)
Copy of the give file to the connected server into the path.java.util.List<java.lang.String>
list(java.lang.String path)
void
setBinaryTransfer(boolean isBinary)
void
setPassiveMode(boolean isPassive)
-
-
-
Method Detail
-
connect
public void connect(java.lang.String hostname, java.lang.String username, java.lang.String password, java.lang.Long port, java.lang.Long timeout) throws java.io.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:
java.io.IOException
-
copy
public void copy(java.lang.String path, java.lang.String fileName, java.io.InputStream file) throws java.io.IOException
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:
java.io.IOException
-
list
public java.util.List<java.lang.String> list(java.lang.String path) throws java.io.IOException
- Specified by:
list
in interfaceFtpClientInterface
- Throws:
java.io.IOException
-
setBinaryTransfer
public void setBinaryTransfer(boolean isBinary) throws java.io.IOException
- Specified by:
setBinaryTransfer
in interfaceFtpClientInterface
- Throws:
java.io.IOException
-
setPassiveMode
public void setPassiveMode(boolean isPassive) throws java.io.IOException
- Specified by:
setPassiveMode
in interfaceFtpClientInterface
- Throws:
java.io.IOException
-
closeConnection
public void closeConnection()
Description copied from interface:FtpClientInterface
Close opened connection- Specified by:
closeConnection
in interfaceFtpClientInterface
-
-