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


Java URIException.getMessage方法代碼示例

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


在下文中一共展示了URIException.getMessage方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: testTooLongAfterEscaping

import org.apache.commons.httpclient.URIException; //導入方法依賴的package包/類
public final void testTooLongAfterEscaping() {
    StringBuffer buffer = new StringBuffer("http://www.archive.org/a/");
    // Append bunch of spaces.  When escaped, they'll triple in size.
    for (int i = 0; i < 1024; i++) {
    	buffer.append(" ");
    }
    buffer.append("/index.html");
    String message = null;
    try {
    	UsableURIFactory.getInstance(buffer.toString());
    } catch (URIException e) {
        message = e.getMessage();
    }
    assertTrue("Wrong or no exception: " + message, (message != null) &&
        message.startsWith("Created (escaped) uuri >"));
}
 
開發者ID:iipc,項目名稱:webarchive-commons,代碼行數:17,代碼來源:UsableURIFactoryTest.java

示例2: getURI

import org.apache.commons.httpclient.URIException; //導入方法依賴的package包/類
public URI getURI() {
	try {
		return URI.create(this.httpMethod.getURI().getEscapedURI());
	}
	catch (URIException ex) {
		throw new IllegalStateException("Could not get HttpMethod URI: " + ex.getMessage(), ex);
	}
}
 
開發者ID:bestarandyan,項目名稱:ShoppingMall,代碼行數:9,代碼來源:CommonsClientHttpRequest.java

示例3: addResource

import org.apache.commons.httpclient.URIException; //導入方法依賴的package包/類
protected void addResource(String href, boolean isCollection)
         throws ScanException 
{
   try {
      String path = (Utils.createHttpURL(getBaseURL(), href)).getPath();
      String relPath = path.substring(getBaseURL().getPath().length());
      if (relPath.startsWith(SEPARATOR)) {
         relPath = relPath.substring(1);
      }
      if (isCollection) {
         if (isIncluded(relPath)) {
            if (isExcluded(relPath)) {
               dirsExcluded.add(relPath);
            } else {
               dirsIncluded.add(relPath);
            }
         } else {
            dirsNotIncluded.add(relPath);
         }
      } else {
         if (isIncluded(relPath)) {
            if (isExcluded(relPath)) {
               filesExcluded.add(relPath);
            } else {
               filesIncluded.add(relPath);
            }
        } else {
            filesNotIncluded.add(relPath);
        }
      }
    } 
    catch (URIException e) {
       throw new ScanException(
          "The XML response returned an invalid URL: " + e.getMessage(), e);
    }
 }
 
開發者ID:integrated,項目名稱:jakarta-slide-webdavclient,代碼行數:37,代碼來源:CollectionScanner.java

示例4: toURL

import org.apache.commons.httpclient.URIException; //導入方法依賴的package包/類
public URL toURL() throws MalformedURLException {
  if(relPath!=null)
    return null;
  try {
      return new URL(httpUrl.getURI());
  } catch (URIException e) {
      throw new MalformedURLException(e.getMessage());
  }
}
 
開發者ID:integrated,項目名稱:jakarta-slide-webdavclient,代碼行數:10,代碼來源:WebdavFile.java

示例5: addAuthentication

import org.apache.commons.httpclient.URIException; //導入方法依賴的package包/類
@Override
public void addAuthentication(HttpMethod forMethod, HttpClient forClient) {

	try {

		forMethod.addRequestHeader("Authorization", "token " + accessToken);
		String url = forMethod.getURI().toString();
		
		String separator = url.contains("?") ? "&" : "?";
		url += separator + "access_token=" + getAccessToken();

		forMethod.setURI(new URI(url, true));
	
	} catch (URIException e) {
		throw new SourceControlException("Failed to decode/encode given URI. " + e.getMessage(), e);
	}

}
 
開發者ID:edgehosting,項目名稱:jira-dvcs-connector,代碼行數:19,代碼來源:OAuthAuthentication.java


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