Example usage for org.apache.commons.httpclient URI normalize

List of usage examples for org.apache.commons.httpclient URI normalize

Introduction

In this page you can find the example usage for org.apache.commons.httpclient URI normalize.

Prototype

public void normalize() throws URIException 

Source Link

Document

Normalizes the path part of this URI.

Usage

From source file:org.apache.any23.source.HTTPDocumentSource.java

private String normalize(String uri) throws URISyntaxException {
    try {/*from w ww  . j  a va2  s .  co m*/
        URI normalized = new URI(uri, DefaultHTTPClient.isUrlEncoded(uri));
        normalized.normalize();
        return normalized.toString();
    } catch (URIException e) {
        LOG.warn("Invalid uri: {}", uri);
        LOG.error("Can not convert URL", e);
        throw new URISyntaxException(uri, e.getMessage());
    }
}