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.collective.celos.ci.deploy.JScpWorker.java

public FileObject getFileObjectByUri(String file) throws URISyntaxException, FileSystemException {
    return getFileObjectByUri(URI.create(file));
}

From source file:service.ResourceRESTFacade.java

@POST
@Consumes({ "application/xml", "application/json" })
@Transactional//from   w  ww  .jav  a  2 s.  c o m
public Response create(Resource entity) {
    entityManager.persist(entity);
    return Response.created(URI.create(entity.getIdResource().toString())).build();
}

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

@POST
@Consumes({ "application/xml", "application/json" })
@Transactional//  www.j  av a 2 s. c o m
public Response create(Address entity) {
    entityManager.persist(entity);
    return Response.created(URI.create(entity.getAddressId().toString())).build();
}

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

@POST
@Consumes({ "application/xml", "application/json" })
@Transactional//from  w  w w.ja va2s . c  o  m
public Response create(Listing entity) {
    entityManager.persist(entity);
    return Response.created(URI.create(entity.getListingId().toString())).build();
}

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

@POST
@Consumes({ "application/xml", "application/json" })
@Transactional/*from  w  w  w. j  a v  a  2s.c  o  m*/
public Response create(Payment entity) {
    entityManager.persist(entity);
    return Response.created(URI.create(entity.getPmtId().toString())).build();
}

From source file:com.vmware.identity.openidconnect.common.HttpRequest.java

public static HttpRequest create(HttpServletRequest httpServletRequest) {
    Validate.notNull(httpServletRequest, "httpServletRequest");

    Map<String, String> parameters = new HashMap<String, String>();
    for (Map.Entry<String, String[]> entry : httpServletRequest.getParameterMap().entrySet()) {
        parameters.put(entry.getKey(), entry.getValue()[0]); // just take the first value
    }/*  w  w w  .ja  v  a  2s .  c  o m*/

    String requestUrlString = httpServletRequest.getRequestURL().toString();
    URL requestUrl;
    try {
        requestUrl = new URL(requestUrlString);
    } catch (MalformedURLException e) {
        // this should not happen since the URL is formed off of httpServletRequest.getRequestURL()
        throw new IllegalArgumentException(e);
    }
    URI requestUri = URI.create(requestUrlString);

    return new HttpRequest(httpServletRequest, parameters, requestUrl, requestUri);
}

From source file:ch.iterate.openstack.swift.model.Region.java

public URI getStorageUrl(String container) {
    return URI.create(this.getStorageUrl() + "/" + encode(container));
}

From source file:com.google.mr4c.content.RelativeContentFactory.java

public static URI toRelativeFileURI(File file, File ancestor) {
    String path = toRelativeFilePath(file, ancestor);
    return URI.create("rel:" + path);
}

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

public ProductResult(Product arg, String baseURL) {
    this(arg);/*  w ww .  ja va2s  . c  o m*/
    this.links = new ArrayList<>();
    this.links.add(new Link(URI.create(baseURL + getUriOf(arg)), "self"));
}

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

@POST
@Consumes({ "application/xml", "application/json" })
@Transactional//from  www  .  j a va2  s.c o m
public Response create(CreditCard entity) {
    entityManager.persist(entity);
    return Response.created(URI.create(entity.getCcId().toString())).build();
}