Class GitScmProviderRepository
- java.lang.Object
-
- org.apache.maven.scm.provider.ScmProviderRepository
-
- org.apache.maven.scm.provider.ScmProviderRepositoryWithHost
-
- org.apache.maven.scm.provider.git.repository.GitScmProviderRepository
-
public class GitScmProviderRepository extends ScmProviderRepositoryWithHost
- Author:
- Emmanuel Venisse, Mark Struberg
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringPROTOCOL_FILEuse local file as transportstatic java.lang.StringPROTOCOL_GITuse gits internal protocolstatic java.lang.StringPROTOCOL_HTTPuse the standard port 80 http protocolstatic java.lang.StringPROTOCOL_HTTPSuse the standard port 443 https protocolstatic java.lang.StringPROTOCOL_NONENo special protocol specified.static java.lang.StringPROTOCOL_RSYNCuse rsync for retrieving the data TODO implement!static java.lang.StringPROTOCOL_SEPARATORthis trails every protocolstatic java.lang.StringPROTOCOL_SSHuse secure shell protocolstatic java.lang.StringURL_DELIMITER_FETCHsequence used to delimit the fetch URLstatic java.lang.StringURL_DELIMITER_PUSHsequence used to delimit the push URL
-
Constructor Summary
Constructors Constructor Description GitScmProviderRepository(java.lang.String url)GitScmProviderRepository(java.lang.String url, java.lang.String user, java.lang.String password)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RepositoryUrlgetFetchInfo()java.lang.StringgetFetchUrl()java.lang.StringgetProvider()RepositoryUrlgetPushInfo()java.lang.StringgetPushUrl()java.lang.StringgetRelativePath(ScmProviderRepository ancestor)Get the relative path between the repository provided as argument and the current repository.java.lang.StringtoString()-
Methods inherited from class org.apache.maven.scm.provider.ScmProviderRepositoryWithHost
getHost, getPassphrase, getPort, getPrivateKey, setHost, setPassphrase, setPort, setPrivateKey
-
Methods inherited from class org.apache.maven.scm.provider.ScmProviderRepository
getParent, getPassword, getUser, getWorkItem, isPersistCheckout, isPushChanges, setPassword, setPersistCheckout, setPushChanges, setUser, setWorkItem
-
-
-
-
Field Detail
-
URL_DELIMITER_FETCH
public static final java.lang.String URL_DELIMITER_FETCH
sequence used to delimit the fetch URL- See Also:
- Constant Field Values
-
URL_DELIMITER_PUSH
public static final java.lang.String URL_DELIMITER_PUSH
sequence used to delimit the push URL- See Also:
- Constant Field Values
-
PROTOCOL_SEPARATOR
public static final java.lang.String PROTOCOL_SEPARATOR
this trails every protocol- See Also:
- Constant Field Values
-
PROTOCOL_FILE
public static final java.lang.String PROTOCOL_FILE
use local file as transport- See Also:
- Constant Field Values
-
PROTOCOL_GIT
public static final java.lang.String PROTOCOL_GIT
use gits internal protocol- See Also:
- Constant Field Values
-
PROTOCOL_SSH
public static final java.lang.String PROTOCOL_SSH
use secure shell protocol- See Also:
- Constant Field Values
-
PROTOCOL_HTTP
public static final java.lang.String PROTOCOL_HTTP
use the standard port 80 http protocol- See Also:
- Constant Field Values
-
PROTOCOL_HTTPS
public static final java.lang.String PROTOCOL_HTTPS
use the standard port 443 https protocol- See Also:
- Constant Field Values
-
PROTOCOL_RSYNC
public static final java.lang.String PROTOCOL_RSYNC
use rsync for retrieving the data TODO implement!- See Also:
- Constant Field Values
-
PROTOCOL_NONE
public static final java.lang.String PROTOCOL_NONE
No special protocol specified. Git will either use git:// or ssh:// depending on whether we work locally or over the network- See Also:
- Constant Field Values
-
-
Constructor Detail
-
GitScmProviderRepository
public GitScmProviderRepository(java.lang.String url) throws ScmException- Throws:
ScmException
-
GitScmProviderRepository
public GitScmProviderRepository(java.lang.String url, java.lang.String user, java.lang.String password) throws ScmException- Throws:
ScmException
-
-
Method Detail
-
getProvider
public java.lang.String getProvider()
- Returns:
- either 'git' or 'jgit' depending on the underlying implementation being used
-
getFetchInfo
public RepositoryUrl getFetchInfo()
-
getPushInfo
public RepositoryUrl getPushInfo()
-
getFetchUrl
public java.lang.String getFetchUrl()
- Returns:
- the URL used to fetch from the upstream repository
-
getPushUrl
public java.lang.String getPushUrl()
- Returns:
- the URL used to push to the upstream repository
-
getRelativePath
public java.lang.String getRelativePath(ScmProviderRepository ancestor)
Get the relative path between the repository provided as argument and the current repository.- Overrides:
getRelativePathin classScmProviderRepository- Parameters:
ancestor- another repository that should be ancestor of this one- Returns:
- the relative path or
nullif it can't be resolved
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-