Class SFTPRepository
java.lang.Object
org.apache.ivy.plugins.repository.AbstractRepository
org.apache.ivy.plugins.repository.ssh.AbstractSshBasedRepository
org.apache.ivy.plugins.repository.sftp.SFTPRepository
- All Implemented Interfaces:
Repository
SFTP Repository, allow to use a repository accessed by sftp protocol. It supports all operations:
get, put and list. It relies on jsch for sftp handling, and thus is compatible with sftp version
0, 1, 2 and 3
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Fetch a resource from the repository.protected String
getResource
(String source) Return the resource associated with a specified identifier.Return a listing of resources namesopenStream
(SFTPResource resource) void
resolveResource
(String path) This method is similar to getResource, except that the returned resource is fully initialized (resolved in the sftp repository), and that the given string is a full remote pathMethods 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
-
SFTPRepository
public SFTPRepository() -
SFTPRepository
-
-
Method Details
-
getResource
Description copied from interface:Repository
Return the resource associated with a specified identifier. If the resource does not exist, it should return a Resource with exists() returning false. An IOException should only be thrown when a real IO problem occurs, like the impossibility to connect to a server.- Parameters:
source
- A string identifying the resource.- Returns:
- The resource associated with the resource identifier.
-
resolveResource
This method is similar to getResource, except that the returned resource is fully initialized (resolved in the sftp repository), and that the given string is a full remote path- Parameters:
path
- the full remote path in the repository of the resource- Returns:
- a fully initialized resource, able to answer to all its methods without needing any further connection
-
openStream
- 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.
-
put
- Overrides:
put
in classAbstractRepository
- Throws:
IOException
-
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.
-
getRepositoryScheme
- Specified by:
getRepositoryScheme
in classAbstractSshBasedRepository
-