Package java.net

Examples of java.net.URI.toASCIIString()


    public ID getID() {
        File mapFile = jGrassMapEnvironment.getMapFile();
        try {
            URL identifier = getIdentifier();
            URI uri = identifier.toURI();
            String asciiString = uri.toASCIIString();
            return new ID(asciiString, identifier, mapFile, uri, "grass");
            // return new ID(getIdentifier());
        } catch (URISyntaxException e) {
            e.printStackTrace();
        }
View Full Code Here


            // comparing (for example symbolic links)
                        String canonicalPath = file.getCanonicalPath();
            File canonicalFile = file.getCanonicalFile();
            canonicalFile = new File(canonicalPath.substring(0, canonicalPath.length() - fragment.length() - 1));
            URI canonicalURI = canonicalFile.toURI();
            this.uri = new URI(canonicalURI.toASCIIString()+"#"+uri.getRawFragment());
           
            // this results in "re"encoding messing up use of spaces
//            this.uri = new URI(canonicalURI.getScheme(),
//                canonicalURI.getRawSchemeSpecificPart(),
//                this.uri.getFragment());
View Full Code Here

    }
    catch (final URISyntaxException urise)
    {
      throw new ConfigurationException("Unexpected exception creating FTP URI, " + urise.getMessage()) ;
    }
    toElement.setAttribute(ListenerTagNames.URL_TAG, uri.toASCIIString());
    toElement.setAttribute(FTPEpr.INPUT_SUFFIX_TAG, messageFilter.getInputSuffix());
    toElement.setAttribute(FTPEpr.WORK_SUFFIX_TAG, messageFilter.getWorkSuffix());
    toElement.setAttribute(FTPEpr.POST_DEL_TAG, String.valueOf(messageFilter.getPostDelete()));
    toElement.setAttribute(FTPEpr.POST_RENAME_TAG, String.valueOf(messageFilter.getPostRename()));
View Full Code Here

    }
    catch (final URISyntaxException urise)
    {
      throw new ConfigurationException("Unexpected exception creating FTP URI, " + urise.getMessage()) ;
    }
    toElement.setAttribute(ListenerTagNames.URL_TAG, uri.toASCIIString());
    toElement.setAttribute(FTPEpr.INPUT_SUFFIX_TAG, messageFilter.getInputSuffix());
    toElement.setAttribute(FTPEpr.WORK_SUFFIX_TAG, messageFilter.getWorkSuffix());
    toElement.setAttribute(FTPEpr.POST_DEL_TAG, String.valueOf(messageFilter.getPostDelete()));
    toElement.setAttribute(FTPEpr.POST_RENAME_TAG, String.valueOf(messageFilter.getPostRename()));
   
View Full Code Here

    }
    catch (final URISyntaxException urise)
    {
      throw new ConfigurationException("Unexpected exception creating FTP URI, " + urise.getMessage()) ;
    }
    toElement.setAttribute(ListenerTagNames.URL_TAG, uri.toASCIIString());
    toElement.setAttribute(FTPEpr.INPUT_SUFFIX_TAG, messageFilter.getInputSuffix());
    toElement.setAttribute(FTPEpr.WORK_SUFFIX_TAG, messageFilter.getWorkSuffix());
    toElement.setAttribute(FTPEpr.POST_DEL_TAG, String.valueOf(messageFilter.getPostDelete()));
    if (!messageFilter.getPostDelete()) {
      toElement.setAttribute(FTPEpr.POST_DIR_TAG, messageFilter.getPostDirectory());
View Full Code Here

    }
    catch (final URISyntaxException urise)
    {
      throw new ConfigurationException("Unexpected exception creating FTP URI, " + urise.getMessage()) ;
    }
    toElement.setAttribute(ListenerTagNames.URL_TAG, uri.toASCIIString());
    toElement.setAttribute(FTPEpr.INPUT_SUFFIX_TAG, messageFilter.getInputSuffix());
    toElement.setAttribute(FTPEpr.WORK_SUFFIX_TAG, messageFilter.getWorkSuffix());
    toElement.setAttribute(FTPEpr.POST_DEL_TAG, String.valueOf(messageFilter.getPostDelete()));
    toElement.setAttribute(FTPEpr.POST_RENAME_TAG, String.valueOf(messageFilter.getPostRename()));
View Full Code Here

  }
 
  public static HttpRequest create(HttpMethod method, String action) throws URISyntaxException {
    URI uri = new URI(action);
    HttpRequest request = new DefaultHttpRequest(
        new HttpVersion("STREST", 0, 1, true), method, uri.toASCIIString());
       
//        request.setHeader(HttpHeaders.Names.ACCEPT_ENCODING, HttpHeaders.Values.GZIP);
        request.setHeader(StrestUtil.HEADERS.TXN_ID, generateTxnId());
        request.setProtocolVersion(new HttpVersion("STREST", 0, 1, true));
        return request;
View Full Code Here

        UriBuilder uriBuilder = UriBuilder.fromPath("");
        uriBuilder.path("{w}");
        Map<String, String> values = new HashMap<String, String>();
        values.put("w", "somerootlesspath");
        URI uri = uriBuilder.buildFromEncodedMap(values);
        assertEquals("somerootlesspath", uri.toASCIIString());

        uriBuilder = UriBuilder.fromPath("{w}");
        values = new HashMap<String, String>();
        values.put("w", "somerootlesspath");
        uri = uriBuilder.buildFromEncodedMap(values);
View Full Code Here

        uriBuilder = UriBuilder.fromPath("{w}");
        values = new HashMap<String, String>();
        values.put("w", "somerootlesspath");
        uri = uriBuilder.buildFromEncodedMap(values);
        assertEquals("somerootlesspath", uri.toASCIIString());
    }

    public void testQueryIllegal() {
        UriBuilder uriBuilder = UriBuilder.fromPath("");
        try {
View Full Code Here

        String method = getMethod();
        ProtocolVersion ver = getProtocolVersion();
        URI uri = getURI();
        String uritext = null;
        if (uri != null) {
            uritext = uri.toASCIIString();
        }
        if (uritext == null || uritext.length() == 0) {
            uritext = "/";
        }
        return new BasicRequestLine(method, uritext, ver);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.