public abstract class AbstractGitWagon
extends org.apache.maven.wagon.StreamWagon
Constructor and Description |
---|
AbstractGitWagon() |
Modifier and Type | Method and Description |
---|---|
abstract GitUri |
buildGitUri(URI repositoryUrl)
Builds the wagon specific Git URI based on the repository URL.
|
void |
closeConnection()
This will commit the local changes and push them to the repository.
|
void |
fillInputData(org.apache.maven.wagon.InputData inputData)
This will read from the working copy.
|
void |
fillOutputData(org.apache.maven.wagon.OutputData outputData)
This will write to the working copy.
|
protected abstract File |
getFileForResource(String resourceName)
This will get the file object for the given resource relative to the
Git specified for the connection. |
List<String> |
getFileList(String directory) |
protected org.eclipse.jgit.api.Git |
getGit(String gitRepositoryUri)
This will create or refresh the working copy.
|
protected GitUri |
getGitUri() |
protected void |
openConnectionInternal()
Sets the initial git URI.
|
void |
putDirectory(File sourceDirectory,
String destinationDirectory)
If the destination directory is not inside the source directory (denoted
by starting with "../"), then another git repository is registered.
|
boolean |
resourceExists(String resourceName) |
boolean |
supportsDirectoryCopy()
Directory copy is supported.
|
checkInputStream, checkOutputStream, get, getIfNewer, getIfNewerToStream, getInputStream, getOutputStream, getToStream, put, putFromStream, putFromStream, putFromStream
addSessionListener, addTransferListener, cleanupGetTransfer, cleanupPutTransfer, connect, connect, connect, connect, connect, connect, createParentDirectories, disconnect, finishGetTransfer, finishPutTransfer, fireGetCompleted, fireGetInitiated, fireGetStarted, firePutCompleted, firePutInitiated, firePutStarted, fireSessionConnectionRefused, fireSessionDebug, fireSessionDisconnected, fireSessionDisconnecting, fireSessionError, fireSessionLoggedIn, fireSessionLoggedOff, fireSessionOpened, fireSessionOpening, fireTransferDebug, fireTransferError, fireTransferProgress, getAuthenticationInfo, getPath, getPermissionsOverride, getProxyInfo, getProxyInfo, getReadTimeout, getRepository, getSessionEventSupport, getTimeout, getTransfer, getTransfer, getTransfer, getTransfer, getTransfer, getTransfer, getTransferEventSupport, hasSessionListener, hasTransferListener, isInteractive, openConnection, postProcessListeners, putTransfer, putTransfer, removeSessionListener, removeTransferListener, setInteractive, setPermissionsOverride, setReadTimeout, setSessionEventSupport, setTimeout, setTransferEventSupport, transfer, transfer, transfer, transfer
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addSessionListener, addTransferListener, connect, connect, connect, connect, connect, connect, disconnect, getReadTimeout, getRepository, getTimeout, hasSessionListener, hasTransferListener, isInteractive, openConnection, removeSessionListener, removeTransferListener, setInteractive, setReadTimeout, setTimeout
public abstract GitUri buildGitUri(URI repositoryUrl) throws IOException, URISyntaxException
repositoryUrl
- repository URLIOException
URISyntaxException
public void closeConnection() throws org.apache.maven.wagon.ConnectionException
closeConnection
in class org.apache.maven.wagon.StreamWagon
org.apache.maven.wagon.ConnectionException
public void fillInputData(org.apache.maven.wagon.InputData inputData) throws org.apache.maven.wagon.TransferFailedException, org.apache.maven.wagon.ResourceDoesNotExistException, org.apache.maven.wagon.authorization.AuthorizationException
fillInputData
in class org.apache.maven.wagon.StreamWagon
org.apache.maven.wagon.ResourceDoesNotExistException
- when the file does not existorg.apache.maven.wagon.authorization.AuthorizationException
- when the file cannot be readorg.apache.maven.wagon.TransferFailedException
public void fillOutputData(org.apache.maven.wagon.OutputData outputData) throws org.apache.maven.wagon.TransferFailedException
fillOutputData
in class org.apache.maven.wagon.StreamWagon
org.apache.maven.wagon.TransferFailedException
protected abstract File getFileForResource(String resourceName) throws org.eclipse.jgit.api.errors.GitAPIException, IOException, URISyntaxException
Git
specified for the connection. It will handle resources where
it jumps up past the parent folder.resourceName
- resource name.IOException
org.eclipse.jgit.api.errors.GitAPIException
- problem with the GIT API.URISyntaxException
org.apache.maven.wagon.ResourceDoesNotExistException
public List<String> getFileList(String directory) throws org.apache.maven.wagon.TransferFailedException, org.apache.maven.wagon.ResourceDoesNotExistException, org.apache.maven.wagon.authorization.AuthorizationException
Warnings are suppressed for false positive with Sonar and multiple exceptions on public API.
getFileList
in interface org.apache.maven.wagon.Wagon
getFileList
in class org.apache.maven.wagon.AbstractWagon
org.apache.maven.wagon.TransferFailedException
org.apache.maven.wagon.ResourceDoesNotExistException
org.apache.maven.wagon.authorization.AuthorizationException
protected org.eclipse.jgit.api.Git getGit(String gitRepositoryUri) throws org.eclipse.jgit.api.errors.GitAPIException, IOException, URISyntaxException, org.apache.maven.wagon.ResourceDoesNotExistException
gitRepositoryUri
- remote git repository URI stringorg.eclipse.jgit.api.errors.GitAPIException
IOException
URISyntaxException
org.apache.maven.wagon.ResourceDoesNotExistException
protected GitUri getGitUri()
protected void openConnectionInternal() throws org.apache.maven.wagon.ConnectionException, org.apache.maven.wagon.authentication.AuthenticationException
openConnectionInternal
in class org.apache.maven.wagon.AbstractWagon
org.apache.maven.wagon.ConnectionException
org.apache.maven.wagon.authentication.AuthenticationException
public void putDirectory(File sourceDirectory, String destinationDirectory) throws org.apache.maven.wagon.TransferFailedException, org.apache.maven.wagon.ResourceDoesNotExistException, org.apache.maven.wagon.authorization.AuthorizationException
putDirectory
in interface org.apache.maven.wagon.Wagon
putDirectory
in class org.apache.maven.wagon.AbstractWagon
org.apache.maven.wagon.TransferFailedException
org.apache.maven.wagon.ResourceDoesNotExistException
org.apache.maven.wagon.authorization.AuthorizationException
public boolean resourceExists(String resourceName) throws org.apache.maven.wagon.TransferFailedException
resourceExists
in interface org.apache.maven.wagon.Wagon
resourceExists
in class org.apache.maven.wagon.AbstractWagon
org.apache.maven.wagon.TransferFailedException
public boolean supportsDirectoryCopy()
supportsDirectoryCopy
in interface org.apache.maven.wagon.Wagon
supportsDirectoryCopy
in class org.apache.maven.wagon.AbstractWagon
Copyright © 2012–2014 Trajano. All rights reserved.