Class SshRepository
java.lang.Object
org.apache.ivy.plugins.repository.AbstractRepository
org.apache.ivy.plugins.repository.ssh.AbstractSshBasedRepository
org.apache.ivy.plugins.repository.ssh.SshRepository
- All Implemented Interfaces:
Repository
Ivy Repository based on SSH
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Fetch a resource from the repository.protected String
return ssh as scheme use the Resolver type name here? would be nice if it would be static, so we could use SshResolver.getTypeName()getResource
(String source) create a new resource with lazy initializingReturn a listing of resources namesopenStream
(SshResource resource) Not really streaming...need to implement a proper streaming approach?void
resolveResource
(String source) Fetch the needed file information for a given file (size, last modification time) and report it back in a SshResourcevoid
setCreateDirCommand
(String createDirCommand) void
setExistCommand
(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
(String cmd) sets the list command to use for a directory listing listing must be only the filename and each filename on a separate linevoid
setPublishPermissions
(String permissions) A four digit string (e.g., 0644, see "man chmod", "man open") specifying the permissions of the published files.Methods inherited from class org.apache.ivy.plugins.repository.ssh.AbstractSshBasedRepository
getHost, getKeyFile, getKeyFilePassword, getPassFile, getPort, getSession, getSshConfig, getUser, getUserPassword, isAllowedAgentUse, releaseSession, setAllowedAgentUse, setHost, setKeyFile, setKeyFilePassword, setPassFile, setPort, setSshConfig, setUser, setUserPassword
Methods inherited from class org.apache.ivy.plugins.repository.AbstractRepository
addTransferListener, fireTransferCompleted, fireTransferCompleted, fireTransferError, fireTransferError, fireTransferEvent, fireTransferInitiated, fireTransferProgress, fireTransferStarted, fireTransferStarted, getFileSeparator, getName, getTimeoutConstraint, hasTransferListener, put, removeTransferListener, setName, standardize, toString
-
Constructor Details
-
SshRepository
public SshRepository() -
SshRepository
-
-
Method Details
-
getResource
create a new resource with lazy initializing- Parameters:
source
- String- Returns:
- Resource
-
resolveResource
Fetch the needed file information for a given file (size, last modification time) and report it back in a SshResource- Parameters:
source
- ssh uri for the file to get info for- Returns:
- SshResource filled with the needed information
- See Also:
-
list
Description copied from interface:Repository
Return a listing of resources names- Parameters:
parent
- The parent directory from which to generate the listing.- Returns:
- A listing of the parent directory's file content
- Throws:
IOException
- On listing failure.
-
put
- Overrides:
put
in classAbstractRepository
- Throws:
IOException
-
get
Description copied from interface:Repository
Fetch a resource from the repository.- Parameters:
source
- A string identifying the resource to be fetched.destination
- Where to place the fetched resource.- Throws:
IOException
- On retrieval failure.
-
setListCommand
sets the list command to use for a directory listing listing must be only the filename and each filename on a separate line- Parameters:
cmd
- to use. default is "ls -1"
-
getListCommand
- Returns:
- the list command to use
-
getCreateDirCommand
- Returns:
- the createDirCommand
-
setCreateDirCommand
- Parameters:
createDirCommand
- the createDirCommand to set
-
getExistCommand
- Returns:
- the existCommand
-
setExistCommand
- Parameters:
existCommand
- the existCommand to set
-
setFileSeparator
public 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. Using the default might be fine- Parameters:
fileSeparator
- The fileSeparator to use. default '/'
-
setPublishPermissions
A four digit string (e.g., 0644, see "man chmod", "man open") specifying the permissions of the published files.- Parameters:
permissions
- 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()- Specified by:
getRepositoryScheme
in classAbstractSshBasedRepository
- Returns:
- String
-
openStream
Not really streaming...need to implement a proper streaming approach?- Parameters:
resource
- to stream- Returns:
- InputStream of the resource data
- Throws:
IOException
- if something goes wrong
-