Package java.net

Examples of java.net.URI.toASCIIString()


    URI newUri = RequestUtils.getURI(request).resolve(location);
    setStatus(SC_MOVED_TEMPORARILY);
    setCharacterEncoding(getCharacterEncoding());
    if (!newUri.isAbsolute()) {
      setHeader("Location", RequestUtils.getRequestURLPrefix(request)
          .append(newUri.toASCIIString()).toString());
    } else {
      setHeader("Location", newUri.toASCIIString());
    }
    redirectSent = true;
  }
View Full Code Here


    setCharacterEncoding(getCharacterEncoding());
    if (!newUri.isAbsolute()) {
      setHeader("Location", RequestUtils.getRequestURLPrefix(request)
          .append(newUri.toASCIIString()).toString());
    } else {
      setHeader("Location", newUri.toASCIIString());
    }
    redirectSent = true;
  }
}
View Full Code Here

        // 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

        PackageRelationshipCollection sheetRels = pkg.getPartsByName(Pattern.compile("/xl/worksheets/sheet1.xml")).get(0).getRelationships();
        assertEquals(3, sheetRels.size());
        PackageRelationship rId1 = sheetRels.getRelationshipByID("rId1");
        assertEquals(TargetMode.EXTERNAL, rId1.getTargetMode());
        URI targetUri = rId1.getTargetURI();
        assertEquals("mailto:nobody@nowhere.uk%C2%A0", targetUri.toASCIIString());
        assertEquals("nobody@nowhere.uk\u00A0", targetUri.getSchemeSpecificPart());

        ByteArrayOutputStream out = new ByteArrayOutputStream();
        pkg.save(out);
        out.close();
View Full Code Here

        sheetRels = pkg.getPartsByName(Pattern.compile("/xl/worksheets/sheet1.xml")).get(0).getRelationships();
        assertEquals(3, sheetRels.size());
        rId1 = sheetRels.getRelationshipByID("rId1");
        assertEquals(TargetMode.EXTERNAL, rId1.getTargetMode());
        targetUri = rId1.getTargetURI();
        assertEquals("mailto:nobody@nowhere.uk%C2%A0", targetUri.toASCIIString());
        assertEquals("nobody@nowhere.uk\u00A0", targetUri.getSchemeSpecificPart());

    }
}
View Full Code Here

        PackageRelationshipCollection sheetRels = pkg.getPartsByName(Pattern.compile("/xl/worksheets/sheet1.xml")).get(0).getRelationships();
        assertEquals(3, sheetRels.size());
        PackageRelationship rId1 = sheetRels.getRelationshipByID("rId1");
        assertEquals(TargetMode.EXTERNAL, rId1.getTargetMode());
        URI targetUri = rId1.getTargetURI();
        assertEquals("mailto:nobody@nowhere.uk%C2%A0", targetUri.toASCIIString());
        assertEquals("nobody@nowhere.uk\u00A0", targetUri.getSchemeSpecificPart());

        ByteArrayOutputStream out = new ByteArrayOutputStream();
        pkg.save(out);
        out.close();
View Full Code Here

        sheetRels = pkg.getPartsByName(Pattern.compile("/xl/worksheets/sheet1.xml")).get(0).getRelationships();
        assertEquals(3, sheetRels.size());
        rId1 = sheetRels.getRelationshipByID("rId1");
        assertEquals(TargetMode.EXTERNAL, rId1.getTargetMode());
        targetUri = rId1.getTargetURI();
        assertEquals("mailto:nobody@nowhere.uk%C2%A0", targetUri.toASCIIString());
        assertEquals("nobody@nowhere.uk\u00A0", targetUri.getSchemeSpecificPart());
    }
   
    public void testEntitiesInRels_56164() throws Exception {
        InputStream is = OpenXML4JTestDataSamples.openSampleStream("PackageRelsHasEntities.ooxml");
View Full Code Here

        }
       
        dispatchUri = selectDispatchUri(endpoint, exchange);
       
        if (exchange.getPattern() == ExchangePattern.InOnly) {
            reply = producer.send(dispatchUri.toASCIIString(), exchange);
        } else {
            reply = issueRequest(endpoint, ExchangePattern.InOut, exchange.getIn().getBody(), exchange.getIn().getHeaders());
        }

        return reply;
View Full Code Here

        }
       
        dispatchUri = selectDispatchUri(endpoint, exchange);
       
        if (exchange.getPattern() == ExchangePattern.InOnly) {
            producer.asyncSend(dispatchUri.toASCIIString(), exchange);
            reply = exchange;
        } else {
            Future<Exchange> future = producer.asyncCallback(dispatchUri.toASCIIString(), exchange, new SynchronizationAdapter());
            reply = future.get(endpoint.getConfig().getConnectionTimeout(), TimeUnit.MILLISECONDS);
        }
View Full Code Here

       
        if (exchange.getPattern() == ExchangePattern.InOnly) {
            producer.asyncSend(dispatchUri.toASCIIString(), exchange);
            reply = exchange;
        } else {
            Future<Exchange> future = producer.asyncCallback(dispatchUri.toASCIIString(), exchange, new SynchronizationAdapter());
            reply = future.get(endpoint.getConfig().getConnectionTimeout(), TimeUnit.MILLISECONDS);
        }
       
        return reply;
    }
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.