本文整理匯總了Java中org.tmatesoft.svn.core.SVNURL.getHost方法的典型用法代碼示例。如果您正苦於以下問題:Java SVNURL.getHost方法的具體用法?Java SVNURL.getHost怎麽用?Java SVNURL.getHost使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.tmatesoft.svn.core.SVNURL
的用法示例。
在下文中一共展示了SVNURL.getHost方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getReadTimeout
import org.tmatesoft.svn.core.SVNURL; //導入方法依賴的package包/類
public int getReadTimeout(@NotNull SVNURL url) {
String protocol = url.getProtocol();
if (HTTP.equals(protocol) || HTTPS.equals(protocol)) {
String host = url.getHost();
String timeout = getServersPropertyIdea(host, "http-timeout");
if (timeout != null) {
try {
return Integer.parseInt(timeout) * 1000;
}
catch (NumberFormatException nfe) {
// use default
}
}
return DEFAULT_READ_TIMEOUT;
}
if (SVN_SSH.equals(protocol)) {
return (int)getConfig().getSshReadTimeout();
}
return 0;
}
示例2: checkHostGroup
import org.tmatesoft.svn.core.SVNURL; //導入方法依賴的package包/類
public static boolean checkHostGroup(final String url, final String patterns, final String exceptions) {
final SVNURL svnurl;
try {
svnurl = SVNURL.parseURIEncoded(url);
}
catch (SVNException e) {
return false;
}
final String host = svnurl.getHost();
return matches(patterns, host) && (! matches(exceptions, host));
}
示例3: getRepo
import org.tmatesoft.svn.core.SVNURL; //導入方法依賴的package包/類
@Override
public SVNRepository getRepo(SVNURL url, boolean mayReuse) throws SVNException {
synchronized (myLock) {
if (myDisposed) throw new ProcessCanceledException();
final String host = url.getHost();
RepoGroup group = myGroups.get(host);
if (group == null) {
group = new RepoGroup(myCreator, myMaxCached, myMaxConcurrent, myAdjuster, myGuard, myLock, myConnectionTimeout);
}
myGroups.put(host, group);
return group.getRepo(url, mayReuse);
}
}
示例4: createProxy
import org.tmatesoft.svn.core.SVNURL; //導入方法依賴的package包/類
private ISVNProxyManager createProxy(SVNURL url) {
// this code taken from default manager (changed for system properties reading)
String host = url.getHost();
String proxyHost = getServersPropertyIdea(host, HTTP_PROXY_HOST);
if (StringUtil.isEmptyOrSpaces(proxyHost)) {
if (getConfig().isIsUseDefaultProxy()) {
// ! use common proxy if it is set
try {
final List<Proxy> proxies = HttpConfigurable.getInstance().getOnlyBySettingsSelector().select(new URI(url.toString()));
if (proxies != null && ! proxies.isEmpty()) {
for (Proxy proxy : proxies) {
if (HttpConfigurable.isRealProxy(proxy) && Proxy.Type.HTTP.equals(proxy.type())) {
final SocketAddress address = proxy.address();
if (address instanceof InetSocketAddress) {
return new MyPromptingProxyManager(((InetSocketAddress)address).getHostName(),
String.valueOf(((InetSocketAddress)address).getPort()), url.getProtocol());
}
}
}
}
}
catch (URISyntaxException e) {
LOG.info(e);
}
}
return null;
}
String proxyExceptions = getServersPropertyIdea(host, "http-proxy-exceptions");
String proxyExceptionsSeparator = ",";
if (proxyExceptions == null) {
proxyExceptions = System.getProperty("http.nonProxyHosts");
proxyExceptionsSeparator = "|";
}
if (proxyExceptions != null) {
for(StringTokenizer exceptions = new StringTokenizer(proxyExceptions, proxyExceptionsSeparator); exceptions.hasMoreTokens();) {
String exception = exceptions.nextToken().trim();
if (DefaultSVNOptions.matches(exception, host)) {
return null;
}
}
}
String proxyPort = getServersPropertyIdea(host, HTTP_PROXY_PORT);
String proxyUser = getServersPropertyIdea(host, HTTP_PROXY_USERNAME);
String proxyPassword = getServersPropertyIdea(host, HTTP_PROXY_PASSWORD);
return new MySimpleProxyManager(proxyHost, proxyPort, proxyUser, proxyPassword);
}
示例5: CredentialsAuthenticator
import org.tmatesoft.svn.core.SVNURL; //導入方法依賴的package包/類
CredentialsAuthenticator(@NotNull AuthenticationService authenticationService, @NotNull SVNURL url, @Nullable String realm) {
super(authenticationService, url, realm == null ? url.getHost() : realm);
}