public class SshRepository extends AbstractSshBasedRepository
Constructor and Description |
---|
SshRepository() |
Modifier and Type | Method and Description |
---|---|
void |
get(java.lang.String source,
java.io.File destination)
Fetch a resource from the repository.
|
java.lang.String |
getCreateDirCommand() |
java.lang.String |
getExistCommand() |
java.lang.String |
getListCommand() |
protected java.lang.String |
getRepositoryScheme()
return ssh as scheme use the Resolver type name here? would be nice if it would be static, so
we could use SshResolver.getTypeName()
|
Resource |
getResource(java.lang.String source)
create a new resource with lazy initializing
|
java.util.List |
list(java.lang.String parent)
Return a listing of resources names
|
java.io.InputStream |
openStream(SshResource resource)
Not really streaming...need to implement a proper streaming approach?
|
void |
put(java.io.File source,
java.lang.String destination,
boolean overwrite) |
SshResource |
resolveResource(java.lang.String source)
Fetch the needed file information for a given file (size, last modification time) and report
it back in a SshResource
|
void |
setCreateDirCommand(java.lang.String createDirCommand) |
void |
setExistCommand(java.lang.String existCommand) |
void |
setFileSeparator(char fileSeparator)
The file separator is the separator to use on the target system On a unix system it is '/',
but I don't know, how this is solved on different ssh implementations.
|
void |
setListCommand(java.lang.String cmd)
sets the list command to use for a directory listing listing must be only the filename and
each filename on a separate line
|
void |
setPublishPermissions(java.lang.String permissions)
A four digit string (e.g., 0644, see "man chmod", "man open") specifying the permissions of
the published files.
|
getHost, getKeyFile, getKeyFilePassword, getPassFile, getPort, getSession, getUser, getUserPassword, isAllowedAgentUse, releaseSession, setAllowedAgentUse, setHost, setKeyFile, setKeyFilePassword, setPassFile, setPort, setUser, setUserPassword
addTransferListener, fireTransferCompleted, fireTransferCompleted, fireTransferError, fireTransferError, fireTransferEvent, fireTransferInitiated, fireTransferProgress, fireTransferStarted, fireTransferStarted, getFileSeparator, getName, hasTransferListener, put, removeTransferListener, setName, standardize, toString
public Resource getResource(java.lang.String source)
source
- A string identifying the resource.public SshResource resolveResource(java.lang.String source)
source
- ssh uri for the file to get info forRepository.getResource(java.lang.String)
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
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 void setListCommand(java.lang.String cmd)
cmd
- to use. default is "ls -1"public java.lang.String getListCommand()
public java.lang.String getCreateDirCommand()
public void setCreateDirCommand(java.lang.String createDirCommand)
createDirCommand
- the createDirCommand to setpublic java.lang.String getExistCommand()
public void setExistCommand(java.lang.String existCommand)
existCommand
- the existCommand to setpublic void setFileSeparator(char fileSeparator)
fileSeparator
- The fileSeparator to use. default '/'public void setPublishPermissions(java.lang.String permissions)
protected java.lang.String getRepositoryScheme()
getRepositoryScheme
in class AbstractSshBasedRepository
public java.io.InputStream openStream(SshResource resource) throws java.io.IOException
resource
- to streamjava.io.IOException