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


Java URIException.printStackTrace方法代碼示例

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


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

示例1: fromPlain

import org.apache.commons.httpclient.URIException; //導入方法依賴的package包/類
/**
 * Given a plain URI or hostname/hostname+path, give its SURT form.
 * Results may be unpredictable on strings that cannot
 * be interpreted as URIs. 
 * 
 * UURI 'fixup' is applied to the URI before conversion to SURT 
 * form. 
 *
 * @param u URI or almost-URI to consider
 * @return implied SURT prefix form
 */
public static String fromPlain(String u) {
    u = ArchiveUtils.addImpliedHttpIfNecessary(u);
    boolean trailingSlash = u.endsWith("/");
    // ensure all typical UURI cleanup (incl. IDN-punycoding) is done
    try {
        u = UsableURIFactory.getInstance(u).toString();
    } catch (URIException e) {
        e.printStackTrace();
        // allow to continue with original string uri
    }
    // except: don't let UURI-fixup add a trailing slash
    // if it wasn't already there (presence or absence of
    // such slash has special meaning specifying implied
    // SURT prefixes)
    if(!trailingSlash && u.endsWith("/")) {
        u = u.substring(0,u.length()-1);
    }
    // convert to full SURT
    u = SURT.fromURI(u);
    return u;
}
 
開發者ID:iipc,項目名稱:webarchive-commons,代碼行數:33,代碼來源:SURT.java

示例2: getRequestUrl

import org.apache.commons.httpclient.URIException; //導入方法依賴的package包/類
public String getRequestUrl() {
      try {
      	String uri = request.getURI().toString();
      	String url = hc.getHostURL() + uri;
	return url;
} catch (URIException e) {
	// TODO Auto-generated catch block
	e.printStackTrace();
	return null;
}
  }
 
開發者ID:convertigo,項目名稱:convertigo-engine,代碼行數:12,代碼來源:HttpMethodAdapter.java

示例3: addSeedIfLegal

import org.apache.commons.httpclient.URIException; //導入方法依賴的package包/類
/**
 * Adds a url as a seed if possible. Otherwise just prints an error description and returns.
 * @param tweetUrl The url to be added.
 */
private void addSeedIfLegal(String tweetUrl) {
    try {
        CandidateURI curi = CandidateURI.createSeedCandidateURI(UURIFactory.getInstance(tweetUrl));
        System.out.println("Adding seed: '" + curi.toString() + "'");
        addSeed(curi);
    } catch (URIException e1) {
        logger.log(Level.SEVERE, e1.getMessage());
        e1.printStackTrace();
    }
}
 
開發者ID:netarchivesuite,項目名稱:netarchivesuite-svngit-migration,代碼行數:15,代碼來源:TwitterDecidingScope.java

示例4: logRequestHistory

import org.apache.commons.httpclient.URIException; //導入方法依賴的package包/類
/**
 * Log modified request
 *
 * @param httpMethodProxyRequest
 * @param httpServletResponse
 * @param history
 */
private void logRequestHistory(HttpMethod httpMethodProxyRequest, PluginResponse httpServletResponse,
                               History history) {
    try {
        if (requestInformation.get().handle && requestInformation.get().client.getIsActive()) {
            logger.info("Storing history");
            String createdDate;
            SimpleDateFormat sdf = new SimpleDateFormat();
            sdf.setTimeZone(new SimpleTimeZone(0, "GMT"));
            sdf.applyPattern("dd MMM yyyy HH:mm:ss");
            createdDate = sdf.format(new Date()) + " GMT";

            history.setCreatedAt(createdDate);
            history.setRequestURL(HttpUtilities.getURL(httpMethodProxyRequest.getURI().toString()));
            history.setRequestParams(httpMethodProxyRequest.getQueryString() == null ? ""
                                         : httpMethodProxyRequest.getQueryString());
            history.setRequestHeaders(HttpUtilities.getHeaders(httpMethodProxyRequest));
            history.setResponseHeaders(HttpUtilities.getHeaders(httpServletResponse));
            history.setResponseCode(Integer.toString(httpServletResponse.getStatus()));
            history.setResponseContentType(httpServletResponse.getContentType());
            history.setResponseData(httpServletResponse.getContentString());
            history.setResponseBodyDecoded(httpServletResponse.isContentDecoded());
            HistoryService.getInstance().addHistory(history);
            logger.info("Done storing");
        }
    } catch (URIException e) {
        e.printStackTrace();
    }
}
 
開發者ID:groupon,項目名稱:odo,代碼行數:36,代碼來源:Proxy.java

示例5: getHref

import org.apache.commons.httpclient.URIException; //導入方法依賴的package包/類
private String getHref(Response response) {
    String href = response.getHref();
    if (this.decodeResponseHrefs != null) {
        try {
            href = URIUtil.decode(href, this.decodeResponseHrefs);
        }
        catch (URIException e1) {
            // TODO Auto-generated catch block
            e1.printStackTrace();
        }
    }
    return href;
}
 
開發者ID:integrated,項目名稱:jakarta-slide-webdavclient,代碼行數:14,代碼來源:XMLResponseMethodBase.java


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