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:reconf.server.domain.result.AllPropertiesResult.java

public AllPropertiesResult(ComponentKey key, List<PropertyRuleResult> properties, String baseUrl) {
    this.product = key.getProduct();
    this.component = key.getName();
    this.properties = properties;
    this.links = new ArrayList<>();
    this.links.add(new Link(URI.create(baseUrl + getUri()), "self"));
}

From source file:org.exoplatform.utils.WebdavMethod.java

public WebdavMethod(String method, String sourceUriStr, String destinationUriStr) {
    this.method = method;
    this.setURI(URI.create(sourceUriStr));
    this.setHeader("Overwrite", "T");
    this.setHeader("Destination", destinationUriStr);
}

From source file:com.grummages.app.rest.entity.service.AuthoritiesRESTFacade.java

@POST
@Consumes({ "application/xml", "application/json" })
@Transactional/*from   w ww .j  a va 2 s.c  om*/
public Response create(Authorities entity) {
    entityManager.persist(entity);
    return Response.created(URI.create(entity.getAuthoritiesId().toString())).build();
}

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

public AllComponentsResult(Product product, List<ComponentResult> components, String baseUrl) {
    this.product = product.getName();
    this.description = product.getDescription();
    this.components = components;
    this.links = new ArrayList<>();
    this.links.add(new Link(URI.create(baseUrl + getUri()), "self"));
}

From source file:com.sap.core.odata.testutil.helper.HttpSomethingUnsupported.java

/**
 * @throws IllegalArgumentException if the uri is invalid.
 *//*from w  w w.  ja  v  a 2  s .c o  m*/
public HttpSomethingUnsupported(final String uri) {
    super();
    setURI(URI.create(uri));
}

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

public ComponentResult(Component arg, String baseURL) {
    this(arg);// w  ww. jav a  2  s . co m
    this.links = new ArrayList<>();
    this.links.add(new Link(URI.create(baseURL + getUriOf(arg)), "self"));
}

From source file:com.nebhale.newrelicservicebroker.catalog.CatalogFactory.java

@Bean
Catalog catalog(@Value("${serviceBroker.serviceId}") String serviceId,
        @Value("${serviceBroker.planId}") String planId) {
    // @formatter:off
    return new Catalog().service().id(UUID.fromString(serviceId)).name("newrelic")
            .description("Manage and monitor your apps").bindable(true)
            .tags("newrelic", "management", "monitoring", "apm").metadata().displayName("New Relic")
            .imageUrl(URI.create("https://newrelic.com/images/logo/logo-newrelic-white.png"))
            .longDescription("New Relic is the all-in-one web app performance tool that lets you see "
                    + "performance from the end user experience, through servers, and down to the "
                    + "line of code.")
            .providerDisplayName("New Relic, Inc.").documentationUrl(URI.create("https://docs.newrelic.com"))
            .supportUrl(URI.create("https://support.newrelic.com/home")).and().plan()
            .id(UUID.fromString(planId)).name("standard").description("Broker for static New Relic credentials")
            .metadata().bullets("JVM Performance analyzer", "Database call response time & throughput",
                    "Performance data API access")
            .displayName("Standard").and().free(true).and().and();
    // @formatter:on
}

From source file:org.codehaus.httpcache4j.AbstractCacheIntegrationTest.java

@BeforeClass
public static void setupServer() throws Exception {
    baseRequestURI = URI.create(String.format("http://localhost:%s/testbed/", JettyServer.PORT));
    baseCustomRequestURI = URI.create(String.format("http://localhost:%s/custom/", JettyServer.PORT));
    System.out.println("::: Starting server :::");
    jettyServer = new Server(JettyServer.PORT);
    final String webapp = "target/testbed/";
    if (!TestUtil.getTestFile(webapp).exists()) {
        throw new IllegalStateException("WebApp dir does not exist!");
    }/*from  w w  w  .  j a  v  a2 s  . c o  m*/
    HandlerList handlerList = new HandlerList();
    Handler webAppHandler = new WebAppContext(webapp, "/testbed");
    handlerList.addHandler(webAppHandler);
    ServletContextHandler contextHandler = new ServletContextHandler(ServletContextHandler.SESSIONS);
    contextHandler.setContextPath("/custom");
    contextHandler.addServlet(VaryResourceServlet.class, "/*");
    handlerList.addHandler(contextHandler);
    jettyServer.setHandler(handlerList);
    jettyServer.start();
}

From source file:com.hmcovisint.dynatraceservicebroker.catalog.CatalogFactory.java

@Bean
Catalog catalog(@Value("${serviceBroker.serviceId}") String serviceId,
        @Value("${serviceBroker.planId}") String planId) {
    // @formatter:off
    return new Catalog().service().id(UUID.fromString(serviceId)).name("dynatrace")
            .description("Manage and monitor your apps").bindable(true)
            .tags("dynatrace", "management", "monitoring", "apm").metadata().displayName("DynaTrace")
            .imageUrl(URI.create(
                    "https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcTiBIZfa-LBmUTk_w78c3n-RHFRfTeLDVd-Mog1xh6cVGbxxud6gQ"))
            .longDescription("DynaTracce is the all-in-one web app performance tool that lets you see "
                    + "performance from the end user experience, through servers, and down to the "
                    + "line of code.")
            .providerDisplayName("DYNATRACE LLC.")
            .documentationUrl(URI.create("http://www.dynatrace.com/en/resources/webinars.html"))
            .supportUrl(URI.create("https://support.dynatrace.com/")).and().plan().id(UUID.fromString(planId))
            .name("standard").description("Broker for static Dynatrace credentials").metadata()
            .bullets("JVM Performance analyzer", "Database call response time & throughput",
                    "Performance data API access")
            .displayName("Standard").and().free(true).and().and();
    // @formatter:on
}

From source file:service.ItemRESTFacade.java

@POST
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@Transactional//from   w w  w . j ava2 s. co  m
public Response create(Item entity) {
    entityManager.persist(entity);
    return Response.created(URI.create(entity.getItemid().toString())).build();
}