|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.maven.wagon.AbstractWagon org.apache.maven.wagon.providers.scm.ScmWagon
public class ScmWagon
Wagon provider to get and put files from and to SCM systems, using Maven-SCM as underlying transport.
TODO it probably creates problems if the same wagon is used in two different SCM protocols, as instance variables can keep incorrect state. TODO: For doing releases we either have to be able to add files with checking out the repository structure which may not be possible, or the checkout directory needs to be a constant. Doing releases won't scale if you have to checkout the whole repository structure in order to add 3 files.
|
Field Summary |
---|
Fields inherited from class org.apache.maven.wagon.AbstractWagon |
---|
authenticationInfo, DEFAULT_BUFFER_SIZE, interactive, proxyInfo, repository, sessionEventSupport, transferEventSupport |
Fields inherited from interface org.apache.maven.wagon.Wagon |
---|
ROLE |
Constructor Summary | |
---|---|
ScmWagon()
|
Method Summary | |
---|---|
void |
closeConnection()
|
void |
get(String resourceName,
File destination)
Downloads specified resource from the repository to given file. |
File |
getCheckoutDirectory()
Get the directory where Wagon will checkout files from SCM. |
List<String> |
getFileList(String resourcePath)
Returns a List of strings naming the files and directories in the directory denoted by
this abstract pathname. |
boolean |
getIfNewer(String resourceName,
File destination,
long timestamp)
Not implemented |
org.apache.maven.scm.manager.ScmManager |
getScmManager()
Get the ScmManager used in this Wagon |
org.apache.maven.scm.provider.ScmProvider |
getScmProvider(String scmType)
Convenience method to get the ScmProvider implementation to handle the provided SCM type |
String |
getScmVersion()
Get the scmVersion used in this Wagon |
String |
getScmVersionType()
Get the scmVersionType used in this Wagon |
void |
openConnectionInternal()
This will cleanup the checkout directory |
void |
put(File source,
String targetName)
Copy a file from local system to remote |
void |
putDirectory(File sourceDirectory,
String destinationDirectory)
Copy a directory from local system to remote |
boolean |
resourceExists(String resourceName)
Check if a remote resource exists |
void |
setCheckoutDirectory(File checkoutDirectory)
Set the directory where Wagon will checkout files from SCM. |
void |
setScmManager(org.apache.maven.scm.manager.ScmManager scmManager)
Set the ScmManager used in this Wagon |
void |
setScmVersion(String scmVersion)
Set the scmVersion |
void |
setScmVersionType(String scmVersionType)
Set the scmVersionType |
boolean |
supportsDirectoryCopy()
Flag indicating if this wagon supports directory copy operations. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ScmWagon()
Method Detail |
---|
public org.apache.maven.scm.manager.ScmManager getScmManager()
ScmManager
used in this Wagon
ScmManager
public void setScmManager(org.apache.maven.scm.manager.ScmManager scmManager)
ScmManager
used in this Wagon
scmManager
- public String getScmVersion()
public void setScmVersion(String scmVersion)
scmVersion
- the scmVersion to setpublic String getScmVersionType()
public void setScmVersionType(String scmVersionType)
scmVersionType
- the scmVersionType to setpublic File getCheckoutDirectory()
public void setCheckoutDirectory(File checkoutDirectory)
checkoutDirectory
- public org.apache.maven.scm.provider.ScmProvider getScmProvider(String scmType) throws org.apache.maven.scm.manager.NoSuchScmProviderException
ScmProvider
implementation to handle the provided SCM type
scmType
- type of SCM, eg. svn
, cvs
ScmProvider
that will handle provided SCM type
org.apache.maven.scm.manager.NoSuchScmProviderException
- if there is no ScmProvider
able to handle that SCM typepublic void openConnectionInternal() throws ConnectionException
openConnectionInternal
in class AbstractWagon
ConnectionException
public void put(File source, String targetName) throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException
Wagon
source
- the local filetargetName
- the remote destination
TransferFailedException
ResourceDoesNotExistException
AuthorizationException
public boolean supportsDirectoryCopy()
Wagon
supportsDirectoryCopy
in interface Wagon
supportsDirectoryCopy
in class AbstractWagon
public void putDirectory(File sourceDirectory, String destinationDirectory) throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException
Wagon
putDirectory
in interface Wagon
putDirectory
in class AbstractWagon
sourceDirectory
- the local directorydestinationDirectory
- the remote destination
TransferFailedException
ResourceDoesNotExistException
AuthorizationException
public void closeConnection() throws ConnectionException
closeConnection
in class AbstractWagon
ConnectionException
public boolean getIfNewer(String resourceName, File destination, long timestamp) throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException
true
if newer resource has been downloaded, false
if resource
in the repository is older or has the same age.
UnsupportedOperationException
- always
TransferFailedException
ResourceDoesNotExistException
AuthorizationException
public void get(String resourceName, File destination) throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException
Wagon
TransferFailedException
ResourceDoesNotExistException
AuthorizationException
public List<String> getFileList(String resourcePath) throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException
Wagon
List
of strings naming the files and directories in the directory denoted by
this abstract pathname.
If this abstract pathname does not denote a directory, or does not exist, then this method throws
ResourceDoesNotExistException
.
Otherwise a List
of strings is returned, one for each file or directory in the directory.
Names denoting the directory itself and the directory's parent directory are not included in
the result. Each string is a file name rather than a complete path.
There is no guarantee that the name strings in the resulting list will appear in any specific
order; they are not, in particular, guaranteed to appear in alphabetical order.
getFileList
in interface Wagon
getFileList
in class AbstractWagon
resourcePath
- directory to list contents of
TransferFailedException
- if there's an error trying to access the remote side
ResourceDoesNotExistException
- if destinationDirectory does not exist or is not a directory
AuthorizationException
- if not authorized to list the contents of the directoryAbstractWagon.getFileList(java.lang.String)
public boolean resourceExists(String resourceName) throws TransferFailedException, AuthorizationException
Wagon
resourceExists
in interface Wagon
resourceExists
in class AbstractWagon
TransferFailedException
- if there's an error trying to access the remote side
AuthorizationException
- if not authorized to verify the existence of the resource
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |