public class GitScmProviderRepository extends ScmProviderRepositoryWithHost
Modifier and Type | Field and Description |
---|---|
private RepositoryUrl |
fetchInfo
the URL used to fetch from the upstream repository
|
private static java.util.regex.Pattern |
HOST_AND_PORT_EXTRACTOR |
static java.lang.String |
PROTOCOL_FILE
use local file as transport
|
static java.lang.String |
PROTOCOL_GIT
use gits internal protocol
|
static java.lang.String |
PROTOCOL_HTTP
use the standard port 80 http protocol
|
static java.lang.String |
PROTOCOL_HTTPS
use the standard port 443 https protocol
|
static java.lang.String |
PROTOCOL_NONE
No special protocol specified.
|
static java.lang.String |
PROTOCOL_RSYNC
use rsync for retrieving the data
TODO implement!
|
static java.lang.String |
PROTOCOL_SEPARATOR
this trails every protocol
|
static java.lang.String |
PROTOCOL_SSH
use secure shell protocol
|
private java.lang.String |
provider
this may either 'git' or 'jgit' depending on the underlying implementation being used
|
private RepositoryUrl |
pushInfo
the URL used to push to the upstream repository
|
static java.lang.String |
URL_DELIMITER_FETCH
sequence used to delimit the fetch URL
|
static java.lang.String |
URL_DELIMITER_PUSH
sequence used to delimit the push URL
|
Constructor and Description |
---|
GitScmProviderRepository(java.lang.String url) |
GitScmProviderRepository(java.lang.String url,
java.lang.String user,
java.lang.String password) |
Modifier and Type | Method and Description |
---|---|
RepositoryUrl |
getFetchInfo() |
java.lang.String |
getFetchUrl() |
java.lang.String |
getProvider() |
RepositoryUrl |
getPushInfo() |
java.lang.String |
getPushUrl() |
java.lang.String |
getRelativePath(ScmProviderRepository ancestor)
Get the relative path between the repository provided as argument and the current repository.
|
private java.lang.String |
getUrl(RepositoryUrl repoUrl) |
private java.lang.String |
parseHostAndPort(RepositoryUrl repoUrl,
java.lang.String url)
Parse server and port from the given url and fill it into the
given RepositoryUrl.
|
private java.lang.String |
parseProtocol(RepositoryUrl repoUrl,
java.lang.String url)
Parse the protocol from the given url and fill it into the given RepositoryUrl.
|
private RepositoryUrl |
parseUrl(java.lang.String url)
Parse the given url string and store all the extracted
information in a
RepositoryUrl |
private java.lang.String |
parseUserInfo(RepositoryUrl repoUrl,
java.lang.String url)
Parse the user information from the given url and fill
user name and password into the given RepositoryUrl.
|
java.lang.String |
toString() |
getHost, getPassphrase, getPort, getPrivateKey, setHost, setPassphrase, setPort, setPrivateKey
getParent, getPassword, getUser, getWorkItem, isPersistCheckout, isPushChanges, setPassword, setPersistCheckout, setPushChanges, setUser, setWorkItem
public static final java.lang.String URL_DELIMITER_FETCH
public static final java.lang.String URL_DELIMITER_PUSH
public static final java.lang.String PROTOCOL_SEPARATOR
public static final java.lang.String PROTOCOL_FILE
public static final java.lang.String PROTOCOL_GIT
public static final java.lang.String PROTOCOL_SSH
public static final java.lang.String PROTOCOL_HTTP
public static final java.lang.String PROTOCOL_HTTPS
public static final java.lang.String PROTOCOL_RSYNC
private static final java.util.regex.Pattern HOST_AND_PORT_EXTRACTOR
public static final java.lang.String PROTOCOL_NONE
private java.lang.String provider
private RepositoryUrl fetchInfo
private RepositoryUrl pushInfo
public GitScmProviderRepository(java.lang.String url) throws ScmException
ScmException
public GitScmProviderRepository(java.lang.String url, java.lang.String user, java.lang.String password) throws ScmException
ScmException
public java.lang.String getProvider()
public RepositoryUrl getFetchInfo()
public RepositoryUrl getPushInfo()
public java.lang.String getFetchUrl()
public java.lang.String getPushUrl()
private RepositoryUrl parseUrl(java.lang.String url) throws ScmException
RepositoryUrl
url
- to parseScmException
private java.lang.String getUrl(RepositoryUrl repoUrl)
repoUrl
- private java.lang.String parseProtocol(RepositoryUrl repoUrl, java.lang.String url) throws ScmException
repoUrl
- url
- ScmException
private java.lang.String parseUserInfo(RepositoryUrl repoUrl, java.lang.String url) throws ScmException
repoUrl
- url
- ScmException
private java.lang.String parseHostAndPort(RepositoryUrl repoUrl, java.lang.String url) throws ScmException
repoUrl
- url
- ScmException
public java.lang.String getRelativePath(ScmProviderRepository ancestor)
getRelativePath
in class ScmProviderRepository
ancestor
- another repository that should be ancestor of this onenull
if it can't be resolvedpublic java.lang.String toString()
toString
in class java.lang.Object