Package org.apache.commons.httpclient

Examples of org.apache.commons.httpclient.URIException


            String toCharset) throws URIException {

        try {
            return new String(target.getBytes(fromCharset), toCharset);
        } catch (UnsupportedEncodingException error) {
            throw new URIException(URIException.UNSUPPORTED_ENCODING,
                    error.getMessage());
        }
    }
View Full Code Here


            String toCharset) throws URIException {

        try {
            return new String(target.getBytes(fromCharset), toCharset);
        } catch (UnsupportedEncodingException error) {
            throw new URIException(URIException.UNSUPPORTED_ENCODING,
                    error.getMessage());
        }
    }
View Full Code Here

  if (uri.startsWith("http://")) {
      return new HttpURL(uri.toCharArray());
  }else if (uri.startsWith("https://")) {
      return new HttpsURL(uri.toCharArray());
  } else {
      throw new URIException("Unknown protocol in URL " + uri);
  }
    }
View Full Code Here

    public static String decode(String escaped) throws URIException {
        try {
            byte[] rawdata = URLCodec.decodeUrl(EncodingUtil.getAsciiBytes(escaped));
            return EncodingUtil.getString(rawdata, URI.getDefaultProtocolCharset());
        } catch (DecoderException e) {
            throw new URIException(e.getMessage());
        }
    }
View Full Code Here

    int _main_port = -1;
    char[] _main_host = null;
    try {
      parseUriReference(url, true);
      if(_host == null) {
        throw new URIException("no host");
      }

      _main_host = mainURI.getRawHost();
      _main_port = mainURI.getPort();

      _true_lor_url = Arrays.equals(_main_host, _host) && _main_port == _port
          && (Arrays.equals(_http_scheme, _scheme) || Arrays.equals(_https_scheme, _scheme));

      /**
       * Пытаемся вычислить, что fragment таки не encode
       */
      if(_fragment != null) {
        String fragmentStr = new String(_fragment);
        String asciiFragment = fragmentStr.replaceAll("[^\\p{ASCII}]", "");
        if(fragmentStr.length() != asciiFragment.length()) {
          throw new URIException("error fragment?");
        }
      }

      findURLIds();
    } catch (URIException ex) {
      parseUriReference(url, false);
      if(_host == null) {
        throw new URIException("no host");
      }

      _main_host = mainURI.getRawHost();
      _main_port = mainURI.getPort();

View Full Code Here

    public static String decode(String escaped) throws URIException {
        try {
            byte[] rawdata = URLCodec.decodeUrl(EncodingUtil.getAsciiBytes(escaped));
            return EncodingUtil.getString(rawdata, URI.getDefaultProtocolCharset());
        } catch (DecoderException e) {
            throw new URIException(e.getMessage());
        }
    }
View Full Code Here

    public static String decode(String escaped) throws URIException {
        try {
            byte[] rawdata = URLCodec.decodeUrl(EncodingUtil.getAsciiBytes(escaped));
            return EncodingUtil.getString(rawdata, URI.getDefaultProtocolCharset());
        } catch (DecoderException e) {
            throw new URIException(e.getMessage());
        }
    }
View Full Code Here

 
  public String urlStringToKey(String url) throws URIException {
    try {
      return keyMaker.makeKey(url);
    } catch (URISyntaxException e) {
      throw new URIException(e.getMessage());
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.commons.httpclient.URIException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.