Example usage for java.net URI create

List of usage examples for java.net URI create

Introduction

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

Prototype

public static URI create(String str) 

Source Link

Document

Creates a URI by parsing the given string.

Usage

From source file:com.ge.predix.test.utils.ZacTestUtil.java

public void assumeZacServerAvailable() {
    // Not all tests use Spring so try to get the URL from the environment.
    if (StringUtils.isEmpty(this.zacUrl)) {
        this.zacUrl = System.getenv("ZAC_URL");
    }//from   www.  j a va 2 s.c o m
    if (!isServerListening(URI.create(this.zacUrl))) {
        throw new SkipException("Skipping tests because ZAC is not available.");
    }
}

From source file:com.orange.clara.cloud.servicedbdumper.helper.UrlForge.java

private String getPortInString() {
    URI appInUri = URI.create(appUri);
    String port = "";
    if (appInUri.getPort() != -1) {
        port = ":" + appInUri.getPort();
    }// ww w .  ja v  a2 s. c o m
    return port;
}

From source file:com.opentable.etcd.EtcdClientFactory.java

public EtcdClient createClient(String uri) {
    return createClient(URI.create(uri));
}

From source file:reconf.server.domain.result.AllRestrictedPropertiesResult.java

public AllRestrictedPropertiesResult(PropertyKey key, List<Rule> rules, String baseUrl) {
    this.product = key.getProduct();
    this.component = key.getComponent();
    this.property = key.getName();

    this.rules = rules;
    this.links = new ArrayList<>();
    this.links.add(new Link(URI.create(baseUrl + getUri()), "self"));

    for (Rule rule : rules) {
        rule.addLink(URI.create(baseUrl + getUri() + "/" + rule.getName()), "self");
    }//from  w  w w .  ja v  a2  s . c o  m
}

From source file:org.olat.core.commons.services.webdav.HttpCopy.java

/**
 * @throws IllegalArgumentException if the uri is invalid.
 */
public HttpCopy(final String uri) {
    super();
    setURI(URI.create(uri));
}

From source file:org.olat.core.commons.services.webdav.HttpMove.java

/**
 * @throws IllegalArgumentException if the uri is invalid.
 */
public HttpMove(final String uri) {
    super();
    setURI(URI.create(uri));
}

From source file:org.olat.core.commons.services.webdav.HttpMkcol.java

/**
 * @throws IllegalArgumentException if the uri is invalid.
 */
public HttpMkcol(final String uri) {
    super();
    setURI(URI.create(uri));
}

From source file:org.apache.taverna.robundle.manifest.PathAnnotation.java

public void generateAnnotationId() {
    setUri(URI.create("urn:uuid:" + UUID.randomUUID()));
}

From source file:org.olat.core.commons.services.webdav.HttpUnlock.java

/**
 * @throws IllegalArgumentException if the uri is invalid.
 */
public HttpUnlock(final String uri) {
    super();
    setURI(URI.create(uri));
}

From source file:org.eel.kitchen.jsonschema.ref.SchemaRegistryTest.java

@Test
public void namespacesAreRespected() throws IOException, JsonSchemaException {
    final URI fullPath = URI.create("foo:/baz#");
    final URIManager manager = new URIManager();
    final URIDownloader downloader = spy(new URIDownloader() {
        @Override//from w  w w. j  a  v  a2  s .co  m
        public InputStream fetch(final URI source) throws IOException {
            if (!fullPath.equals(source))
                throw new IOException();
            return new ByteArrayInputStream(JsonNodeFactory.instance.objectNode().toString().getBytes());
        }
    });
    manager.registerScheme("foo", downloader);

    final URI rootns = URI.create("foo:///bar/../bar/");

    final SchemaRegistry registry = new SchemaRegistry(manager, rootns);

    final URI uri = URI.create("../baz");
    registry.get(uri);
    final JsonRef ref = JsonRef.fromURI(rootns.resolve(uri));
    verify(downloader).fetch(rootns.resolve(ref.toURI()));
}