Example usage for java.net URI toString

List of usage examples for java.net URI toString

Introduction

In this page you can find the example usage for java.net URI toString.

Prototype

public String toString() 

Source Link

Document

Returns the content of this URI as a string.

Usage

From source file:com.unboundid.scim2.common.messages.PatchOperation.java

/**
 * Create a new replace patch operation.
 *
 * @param path The path targeted by this patch operation.  The path
 *             must not be {@code null}.
 * @param value The value(s) to replace.  The value(s) must not be {@code null}.
 *
 * @return The new replace patch operation.
 *///from ww  w .  java 2s  .  c  o m
public static PatchOperation replace(final Path path, final URI value) {
    return replace(path, value.toString());
}

From source file:org.zalando.github.spring.UriTemplateTest.java

@Test
public void checkParameters() {
    Map<String, Object> uriVariables = new HashMap<>();
    uriVariables.put("first", "eins");
    uriVariables.put("second", "zwei");
    uriVariables.put("bar", "baz");
    uriVariables.put("thing", "something");
    URI uri = new UriTemplate("http://example.org/{first}/path/{second}?foo={bar}&bar={thing}")
            .expand(uriVariables);/* w ww  .java  2s.c o m*/

    String uriString = uri.toString();
    Assertions.assertThat(uriString).contains("foo=baz");
    Assertions.assertThat(uriString).contains("bar=something");
    Assertions.assertThat(uriString).contains("eins/path/zwei");
    System.out.println(uri.toString());
}

From source file:net.hamnaberg.json.Link.java

public Link withHref(URI href) {
    ObjectNode node = copyDelegate();
    node.put("href", href.toString());
    return copy(node);
}

From source file:com.nesscomputing.config.util.HttpConfigStrategy.java

public HttpConfigStrategy(@Nonnull final URI webLocation) {
    super(webLocation);
    final String web = webLocation.toString();
    if (web.endsWith("/")) {
        this.webLocation = webLocation;
    } else {//from w ww  .  j a v  a  2s .co m
        this.webLocation = URI.create(web + "/");
    }
    LOG.trace("Searching for configuration at '%s'.", webLocation);
}

From source file:com.edmunds.autotest.ClassResolver.java

private String getURI(Resource resource) {
    try {/*from   ww w  . ja va2 s. co m*/
        final URI uri = resource.getURI();
        if (uri != null) {
            return uri.toString();
        }

    } catch (IOException e) {
        log.info(e);
    }
    return null;
}

From source file:com.unboundid.scim2.common.messages.PatchOperation.java

/**
 * Create a new add patch operation./*from   w  w  w. j  a  va  2s.  co m*/
 *
 * @param path The path targeted by this patch operation.  The path
 *             must not be {@code null}.
 * @param values The values to add.
 *
 * @return The new add patch operation.
 */
public static PatchOperation addURIValues(final Path path, final List<URI> values) {
    ArrayNode arrayNode = JsonUtils.getJsonNodeFactory().arrayNode();
    for (URI value : values) {
        arrayNode.add(value.toString());
    }
    return add(path, arrayNode);
}

From source file:com.jaspersoft.android.jaspermobile.network.cookie.AppCookieStore.java

@Override
public boolean remove(URI uri, HttpCookie cookie) {
    boolean result = mStore.remove(uri, cookie);
    mWebViewCookieStore.removeCookie(uri.toString());
    return result;
}

From source file:com.smartling.cms.gateway.client.internal.CommandChannelWebsocketTransport.java

@Override
public CommandChannelSession connectToServer(Object annotatedEndpoint, URI path)
        throws IOException, CmsGatewayClientException {
    final String maskedPath = path.toString().replaceFirst("key=.*?&", "key=XXXXXXX&");
    logger.debug(String.format("Connecting to command channel at %s", maskedPath));
    try {//from ww  w .j a  va  2s .  co  m
        Session session = container.connectToServer(annotatedEndpoint, path);
        return new WebsocketSession(session, heartbeatInterval);
    } catch (DeploymentException e) {
        throw new CmsGatewayClientException(e);
    }
}

From source file:gmusic.api.comm.HttpUrlConnector.java

private URI adjustAddress(URI address) throws MalformedURLException, URISyntaxException {
    if (address.toString().startsWith("https://play.google.com/music/services/")) {
        return address = new URI(address.toURL() + String.format("?u=0&xt=%1$s", cookie));
    }//from ww w  . j  av  a  2 s . com

    return address;
}

From source file:org.openlmis.fulfillment.service.referencedata.OrderableReferenceDataServiceTest.java

@Test
public void shouldReturnOrderablesById() {
    OrderableDto product = mockPageResponseEntityAndGetDto();

    UUID orderableId = UUID.randomUUID();
    List<OrderableDto> response = service.findByIds(Collections.singleton(orderableId));

    assertThat(response, hasSize(1));//from   w ww . ja  v a 2s  .  c  om
    assertThat(response, hasItem(product));

    verify(restTemplate).exchange(uriCaptor.capture(), eq(HttpMethod.GET), entityCaptor.capture(),
            refEq(new DynamicPageTypeReference<>(OrderableDto.class)));

    URI uri = uriCaptor.getValue();
    assertEquals(serviceUrl + service.getUrl() + "?id=" + orderableId.toString(), uri.toString());

    assertAuthHeader(entityCaptor.getValue());
    assertNull(entityCaptor.getValue().getBody());
}