Examples of toASCIIString()


Examples of java.net.URI.toASCIIString()

                    if (it.hasNext()) {
                        username = it.next();
                    }
                }
                final URI cleanUri = new URI(uri.getScheme(), username, uri.getHost(), uri.getPort(), uri.getPath(), uri.getQuery(), uri.getFragment());
                sb.append(cleanUri.toASCIIString());
            } catch (URISyntaxException e) {
                sb.append("invalid URL");
                // ignore
            }
        }
View Full Code Here

Examples of java.net.URI.toASCIIString()

                    resourceURI = ObrUtils.getRelativeURI( m_baseURI, resourceURI );
                }
            }

            m_resourceBundle.setSize( String.valueOf( bundleFile.length() ) );
            m_resourceBundle.setUri( resourceURI.toASCIIString() );
        }
        else
        {
            m_logger.error( "file doesn't exist: " + m_bundleJar );
            return;
View Full Code Here

Examples of java.net.URI.toASCIIString()

    protected HttpRequestBase createMethod(Exchange exchange) throws Exception {
        // creating the url to use takes 2-steps
        String url = HttpHelper.createURL(exchange, getEndpoint());
        URI uri = HttpHelper.createURI(exchange, url, getEndpoint());
        // get the url from the uri
        url = uri.toASCIIString();

        // execute any custom url rewrite
        String rewriteUrl = HttpHelper.urlRewrite(exchange, url, getEndpoint(), this);
        if (rewriteUrl != null) {
            // update url and query string from the rewritten url
View Full Code Here

Examples of java.net.URI.toASCIIString()

        // create new uri with the parameters
        URI out = URISupport.createRemainingURI(new URI(uri), map);
        assertNotNull(out);
        assertEquals("http://localhost:23271/myapp/mytest?foo=abc+def&bar=123%2C456&name=S%C3%B8ren", out.toString());
        assertEquals("http://localhost:23271/myapp/mytest?foo=abc+def&bar=123%2C456&name=S%C3%B8ren", out.toASCIIString());
    }

    public void testNormalizeEndpointUriWithDualParameters() throws Exception {
        String out1 = URISupport.normalizeUri("smtp://localhost?to=foo&to=bar&from=me");
        assertEquals("smtp://localhost?from=me&to=foo&to=bar", out1);
View Full Code Here

Examples of java.net.URI.toASCIIString()

     *@param policyFile the file containing additional policy
     */
    public static void refreshPolicy(File policyFile) {
        int idx = firstFreePolicyIndex();
        URI policyFileURI = policyFile.toURI();
        java.security.Security.setProperty("policy.url." + idx, policyFileURI.toASCIIString());
        Policy p = Policy.getPolicy();
        p.refresh();
    }
   
    /**
 
View Full Code Here

Examples of java.net.URI.toASCIIString()

   public static String path(CharSequence s)
   {
      try
      {
         final URI uri = new URI("http", "0.0.0.0", "/" + s, null);
         return uri.toASCIIString().substring(15);
      }
      catch (URISyntaxException e)
      {
         throw new IllegalArgumentException(e);
      }
View Full Code Here

Examples of java.net.URI.toASCIIString()

         public String transpose(Rewrite event, EvaluationContext context, String value)
         {
            try
            {
               final URI uri = new URI("http", "localhost", "/" + value, null);
               return uri.toASCIIString().substring(17);
            }
            catch (URISyntaxException e)
            {
               throw new IllegalArgumentException(e);
            }
View Full Code Here

Examples of java.net.URI.toASCIIString()

   private static String encodeSegment(final String segment)
   {
      try
      {
         final URI uri = new URI("http", "localhost", "/" + segment, null);
         return uri.toASCIIString().substring(17);
      }
      catch (URISyntaxException e)
      {
         throw new IllegalArgumentException(e);
      }
View Full Code Here

Examples of java.net.URI.toASCIIString()

      URI uri = new URI(sb.toString());
     
      if(!noRelative)
        uri = strippedBaseURI.relativize(uri);
      if(logMINOR)
        Logger.minor(this, "Returning "+uri.toASCIIString()+" from "+path+" from baseURI="+baseURI+" stripped base uri="+strippedBaseURI.toString());
      return uri.toASCIIString();
    } catch (URISyntaxException e) {
      Logger.error(this, "Could not parse own URI: path="+path+", typeOverride="+typeOverride+", frag="+u.getFragment()+" : "+e, e);
      String p = path;
      if(typeOverride != null)
View Full Code Here

Examples of java.net.URI.toASCIIString()

     
      if(!noRelative)
        uri = strippedBaseURI.relativize(uri);
      if(logMINOR)
        Logger.minor(this, "Returning "+uri.toASCIIString()+" from "+path+" from baseURI="+baseURI+" stripped base uri="+strippedBaseURI.toString());
      return uri.toASCIIString();
    } catch (URISyntaxException e) {
      Logger.error(this, "Could not parse own URI: path="+path+", typeOverride="+typeOverride+", frag="+u.getFragment()+" : "+e, e);
      String p = path;
      if(typeOverride != null)
        p += "?type="+typeOverride;
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.