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


Java SVNURL.getProtocol方法代碼示例

本文整理匯總了Java中org.tmatesoft.svn.core.SVNURL.getProtocol方法的典型用法代碼示例。如果您正苦於以下問題:Java SVNURL.getProtocol方法的具體用法?Java SVNURL.getProtocol怎麽用?Java SVNURL.getProtocol使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.tmatesoft.svn.core.SVNURL的用法示例。


在下文中一共展示了SVNURL.getProtocol方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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: commonScheme

import org.tmatesoft.svn.core.SVNURL; //導入方法依賴的package包/類
private void commonScheme(final SVNURL url, final boolean username, final String realm) throws SVNException {
  String kind = null;

  final String actualRealm = realm == null ? "realm" : realm;
  final String protocol = url.getProtocol();
  if (username) {
    kind = ISVNAuthenticationManager.USERNAME;
  } else if ("svn+ssh".equals(protocol)) {
    kind = ISVNAuthenticationManager.SSH;
  } else if ("http".equals(protocol)) {
    kind = ISVNAuthenticationManager.PASSWORD;
  } else if ("https".equals(protocol)) {
    kind = ISVNAuthenticationManager.SSL;
  } else if ("file".equals(protocol)) {
    kind = ISVNAuthenticationManager.USERNAME;
  }
  SVNAuthentication authentication = null;
  try {
    authentication = myAuthenticationManager.getFirstAuthentication(kind, actualRealm, url);
    while (! passwordSpecified(authentication)) {
      authentication = myAuthenticationManager.getNextAuthentication(kind, actualRealm, url);
    }
  } finally {
    myAuthenticationManager.acknowledgeAuthentication(authentication != null, kind, actualRealm, null, authentication, url);
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:27,代碼來源:SvnAuthenticationTest.java

示例3: getConnectTimeout

import org.tmatesoft.svn.core.SVNURL; //導入方法依賴的package包/類
public int getConnectTimeout(@NotNull SVNURL url) {
  String protocol = url.getProtocol();
  if (SVN_SSH.equals(protocol)) {
    return (int)getConfig().getSshConnectionTimeout();
  }
  final int connectTimeout = getHostOptionsProvider().getHostOptions(url).getConnectTimeout();
  if ((HTTP.equals(protocol) || HTTPS.equals(protocol)) && (connectTimeout <= 0)) {
    return DEFAULT_READ_TIMEOUT;
  }
  return connectTimeout;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:12,代碼來源:SvnAuthenticationManager.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


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