public class VsftpRepository extends AbstractRepository
Constructor and Description |
---|
VsftpRepository() |
Modifier and Type | Method and Description |
---|---|
void |
disconnect() |
protected void |
ensureConnectionOpened() |
void |
get(java.lang.String source,
java.io.File destination)
Fetch a resource from the repository.
|
java.lang.String |
getAuthentication() |
protected java.lang.String |
getConnectionCommand() |
protected java.util.regex.Pattern |
getExpectedDownloadMessage(java.lang.String source,
java.io.File to) |
protected java.util.regex.Pattern |
getExpectedRemoveMessage(java.lang.String destination) |
protected java.util.regex.Pattern |
getExpectedUploadMessage(java.io.File source,
java.lang.String to) |
java.lang.String |
getHost() |
protected Resource |
getInitResource(java.lang.String source) |
long |
getReadTimeout() |
Resource |
getResource(java.lang.String source)
Return the resource associated with a specified identifier.
|
protected java.lang.String |
getSingleCommand(java.lang.String command) |
java.lang.String |
getUsername() |
java.util.List |
list(java.lang.String parent)
Return a listing of resources names
|
protected Resource |
lslToResource(java.lang.String file,
java.lang.String responseLine)
Parses a ls -l line and transforms it in a resource
|
void |
put(java.io.File source,
java.lang.String destination,
boolean overwrite) |
protected java.lang.String |
readResponse(boolean sendErrorAsResponse) |
protected java.lang.String |
readResponse(boolean sendErrorAsResponse,
long timeout) |
protected java.lang.String |
sendCommand(java.lang.String command) |
protected java.lang.String |
sendCommand(java.lang.String command,
boolean sendErrorAsResponse) |
protected java.lang.String |
sendCommand(java.lang.String command,
boolean sendErrorAsResponse,
boolean single) |
protected java.lang.String |
sendCommand(java.lang.String command,
boolean sendErrorAsResponse,
boolean single,
long timeout) |
protected java.lang.String |
sendCommand(java.lang.String command,
boolean sendErrorAsResponse,
long timeout) |
protected void |
sendCommand(java.lang.String command,
java.util.regex.Pattern expectedResponse) |
protected void |
sendCommand(java.lang.String command,
java.util.regex.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.
|
void |
setAuthentication(java.lang.String authentication) |
void |
setHost(java.lang.String host) |
void |
setReadTimeout(long readTimeout) |
void |
setReuseConnection(long time)
Sets the reuse connection time.
|
void |
setUsername(java.lang.String username) |
java.lang.String |
toString() |
addTransferListener, fireTransferCompleted, fireTransferCompleted, fireTransferError, fireTransferError, fireTransferEvent, fireTransferInitiated, fireTransferProgress, fireTransferStarted, fireTransferStarted, getFileSeparator, getName, hasTransferListener, put, removeTransferListener, setName, standardize
public Resource getResource(java.lang.String source) throws java.io.IOException
Repository
source
- A string identifying the resource.java.io.IOException
- On error while trying to get resource.protected Resource getInitResource(java.lang.String source) throws java.io.IOException
java.io.IOException
public void get(java.lang.String source, java.io.File destination) throws java.io.IOException
Repository
source
- A string identifying the resource to be fetched.destination
- Where to place the fetched resource.java.io.IOException
- On retrieval failure.public java.util.List list(java.lang.String parent) throws java.io.IOException
Repository
parent
- The parent directory from which to generate the listing.java.io.IOException
- On listing failure.public void put(java.io.File source, java.lang.String destination, boolean overwrite) throws java.io.IOException
put
in class AbstractRepository
java.io.IOException
protected java.lang.String sendCommand(java.lang.String command) throws java.io.IOException
java.io.IOException
protected void sendCommand(java.lang.String command, java.util.regex.Pattern expectedResponse) throws java.io.IOException
java.io.IOException
protected void sendCommand(java.lang.String command, java.util.regex.Pattern expectedResponse, long timeout) throws java.io.IOException
java.io.IOException
protected java.lang.String sendCommand(java.lang.String command, boolean sendErrorAsResponse) throws java.io.IOException
java.io.IOException
protected java.lang.String sendCommand(java.lang.String command, boolean sendErrorAsResponse, boolean single) throws java.io.IOException
java.io.IOException
protected java.lang.String sendCommand(java.lang.String command, boolean sendErrorAsResponse, long timeout) throws java.io.IOException
java.io.IOException
protected java.lang.String sendCommand(java.lang.String command, boolean sendErrorAsResponse, boolean single, long timeout) throws java.io.IOException
java.io.IOException
protected java.lang.String readResponse(boolean sendErrorAsResponse) throws java.io.IOException
java.io.IOException
protected java.lang.String readResponse(boolean sendErrorAsResponse, long timeout) throws java.io.IOException
java.io.IOException
protected void ensureConnectionOpened() throws java.io.IOException
java.io.IOException
public void disconnect()
protected Resource lslToResource(java.lang.String file, java.lang.String responseLine)
file
- responseLine
- protected java.lang.String getSingleCommand(java.lang.String command)
protected java.lang.String getConnectionCommand()
protected java.util.regex.Pattern getExpectedDownloadMessage(java.lang.String source, java.io.File to)
protected java.util.regex.Pattern getExpectedRemoveMessage(java.lang.String destination)
protected java.util.regex.Pattern getExpectedUploadMessage(java.io.File source, java.lang.String to)
public java.lang.String getAuthentication()
public void setAuthentication(java.lang.String authentication)
public java.lang.String getHost()
public void setHost(java.lang.String host)
public java.lang.String getUsername()
public void setUsername(java.lang.String username)
public java.lang.String toString()
toString
in class AbstractRepository
public void setReuseConnection(long time)
time
- public long getReadTimeout()
public void setReadTimeout(long readTimeout)