org.apache.ivy.plugins.repository.vsftp
Class VsftpRepository
public
class
VsftpRepository
extends AbstractRepository
Repository using SecureCRT vsftp command line program to access an sftp repository This is
especially useful to leverage the gssapi authentication supported by SecureCRT. In caseswhere
usual sftp is enough, prefer the 100% java solution of sftp repository. This requires SecureCRT
to be in the PATH. Tested with SecureCRT 5.0.5
Method Summary |
void | disconnect() |
protected void | ensureConnectionOpened() |
void | get(String source, File destination) |
String | getAuthentication() |
protected String | getConnectionCommand() |
protected Pattern | getExpectedDownloadMessage(String source, File to) |
protected Pattern | getExpectedRemoveMessage(String destination) |
protected Pattern | getExpectedUploadMessage(File source, String to) |
String | getHost() |
protected Resource | getInitResource(String source) |
long | getReadTimeout() |
Resource | getResource(String source) |
protected String | getSingleCommand(String command) |
String | getUsername() |
List | list(String parent) |
protected Resource | lslToResource(String file, String responseLine)
Parses a ls -l line and transforms it in a resource
|
void | put(File source, String destination, boolean overwrite) |
protected String | readResponse(boolean sendErrorAsResponse) |
protected String | readResponse(boolean sendErrorAsResponse, long timeout) |
protected String | sendCommand(String command) |
protected void | sendCommand(String command, Pattern expectedResponse) |
protected void | sendCommand(String command, Pattern expectedResponse, long timeout)
The behaviour of vsftp with some commands is to log the resulting message on the error
stream, even if everything is ok. |
protected String | sendCommand(String command, boolean sendErrorAsResponse) |
protected String | sendCommand(String command, boolean sendErrorAsResponse, boolean single) |
protected String | sendCommand(String command, boolean sendErrorAsResponse, long timeout) |
protected String | sendCommand(String command, boolean sendErrorAsResponse, boolean single, long timeout) |
void | setAuthentication(String authentication) |
void | setHost(String host) |
void | setReadTimeout(long readTimeout) |
void | setReuseConnection(long time)
Sets the reuse connection time. |
void | setUsername(String username) |
String | toString() |
public void disconnect()
protected void ensureConnectionOpened()
public void get(String source, File destination)
public String getAuthentication()
protected String getConnectionCommand()
protected Pattern getExpectedDownloadMessage(String source, File to)
protected Pattern getExpectedRemoveMessage(String destination)
protected Pattern getExpectedUploadMessage(File source, String to)
public String getHost()
protected
Resource getInitResource(String source)
public long getReadTimeout()
public
Resource getResource(String source)
protected String getSingleCommand(String command)
public String getUsername()
public List list(String parent)
protected
Resource lslToResource(String file, String responseLine)
Parses a ls -l line and transforms it in a resource
Parameters: file responseLine
Returns:
public void put(File source, String destination, boolean overwrite)
protected String readResponse(boolean sendErrorAsResponse)
protected String readResponse(boolean sendErrorAsResponse, long timeout)
protected String sendCommand(String command)
protected void sendCommand(String command, Pattern expectedResponse)
protected void sendCommand(String command, Pattern expectedResponse, long timeout)
The behaviour of vsftp with some commands is to log the resulting message on the error
stream, even if everything is ok. So it's quite difficult if there was an error or not. Hence
we compare the response with the expected message and deal with it. The problem is that this
is very specific to the version of vsftp used for the test, That's why expected messages are
obtained using overridable protected methods.
protected String sendCommand(String command, boolean sendErrorAsResponse)
protected String sendCommand(String command, boolean sendErrorAsResponse, boolean single)
protected String sendCommand(String command, boolean sendErrorAsResponse, long timeout)
protected String sendCommand(String command, boolean sendErrorAsResponse, boolean single, long timeout)
public void setAuthentication(String authentication)
public void setHost(String host)
public void setReadTimeout(long readTimeout)
public void setReuseConnection(long time)
Sets the reuse connection time. The same connection will be reused if the time here does not
last between two commands. O indicates that the connection should never be reused
Parameters: time
public void setUsername(String username)
public String toString()