當前位置: 首頁>>代碼示例>>Java>>正文


Java SVNURL.getHost方法代碼示例

本文整理匯總了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;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:21,代碼來源:SvnAuthenticationManager.java

示例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));
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:13,代碼來源:SvnAuthenticationManager.java

示例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);
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:15,代碼來源:CachingSvnRepositoryPool.java

示例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);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:48,代碼來源:SvnAuthenticationManager.java

示例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);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:4,代碼來源:CredentialsAuthenticator.java


注:本文中的org.tmatesoft.svn.core.SVNURL.getHost方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。