Example usage for java.net URISyntaxException getMessage

List of usage examples for java.net URISyntaxException getMessage

Introduction

In this page you can find the example usage for java.net URISyntaxException getMessage.

Prototype

public String getMessage() 

Source Link

Document

Returns a string describing the parse error.

Usage

From source file:lh.api.showcase.server.api.lh.offers.OffersServiceImpl.java

@Override
public String getSeatMaps(String flightNumber, AirportCode origin, AirportCode destination,
        String departureDate, CabinClass cabinClass) throws HttpErrorResponseException {

    // e.g., https://api.lufthansa.com/v1/offers/seatmaps/LH741/KIX/FRA/2015-06-25/C
    OffersRequestFactoryImpl reqFact = new OffersRequestFactoryImpl();
    try {/*from  w  ww . j  av a 2 s.co  m*/
        URI uri = reqFact.getRequestUri((NameValuePair) new BasicNameValuePair("seatmaps", ""),
                (List<NameValuePair>) Arrays.asList((NameValuePair) new BasicNameValuePair(flightNumber, ""),
                        (NameValuePair) new BasicNameValuePair(origin.toString(), ""),
                        (NameValuePair) new BasicNameValuePair(destination.toString(), ""),
                        (NameValuePair) new BasicNameValuePair(departureDate, ""),
                        (NameValuePair) new BasicNameValuePair(cabinClass.toString(), "")),
                null);

        return HttpQueryUtils.executeQuery(uri);

    } catch (URISyntaxException e) {
        logger.log(Level.SEVERE, e.getMessage());
    }
    return null;
}

From source file:$.MyMapping.java

public String map(File file, String pid) {
        try {/*from   w w w .  j ava2s.  c o  m*/
            System.out.println(file.getAbsolutePath());
            return flux(file, pid);
        } catch (URISyntaxException e) {
            logger.error(e.getMessage());
        } catch (IOException e) {
            logger.error(e.getMessage());
        } catch (RecognitionException e) {
            logger.error(e.getMessage());
        }
        return null;
    }

From source file:com.evolveum.polygon.connector.example.rest.ExampleRestConnector.java

@Override
public void test() {
    URIBuilder uriBuilder = getURIBuilder();
    URI uri;//  w w  w  . j a v  a 2 s.c o  m
    try {
        uri = uriBuilder.build();
    } catch (URISyntaxException e) {
        throw new IllegalArgumentException(e.getMessage(), e);
    }
    HttpGet request = new HttpGet(uri);

    HttpResponse response = execute(request);

    processResponseErrors(response);
}

From source file:org.dataconservancy.ui.it.support.ListProjectActivityRequest.java

public HttpPost asHttpPost(String projectId) {

    HttpPost post = null;/*from  ww  w.j  a  va2 s . co m*/
    try {
        post = new HttpPost(urlConfig.getListProjectCollectionsUrl().toURI());
    } catch (URISyntaxException e) {
        throw new RuntimeException(e.getMessage(), e);
    }

    List<NameValuePair> params = new ArrayList<NameValuePair>();
    params.add(new BasicNameValuePair("currentProjectId", projectId));
    params.add(new BasicNameValuePair(STRIPES_EVENT, "List Project Activity"));

    HttpEntity entity = null;
    try {
        entity = new UrlEncodedFormEntity(params, "UTF-8");
    } catch (UnsupportedEncodingException e) {
        throw new RuntimeException(e.getMessage(), e);
    }

    post.setEntity(entity);

    return post;
}

From source file:org.dataconservancy.ui.it.support.ListCollectionsRequest.java

public HttpPost asHttpPost() {

    HttpPost post = null;/*from  www . j  a v  a  2  s . c o  m*/
    try {
        post = new HttpPost(urlConfig.getListCollectionsUrl().toURI());
    } catch (URISyntaxException e) {
        throw new RuntimeException(e.getMessage(), e);
    }

    List<NameValuePair> params = new ArrayList<NameValuePair>();
    params.add(new BasicNameValuePair(STRIPES_EVENT, "List Collections"));

    HttpEntity entity = null;
    try {
        entity = new UrlEncodedFormEntity(params, "UTF-8");
    } catch (UnsupportedEncodingException e) {
        throw new RuntimeException(e.getMessage(), e);
    }

    post.setEntity(entity);

    return post;
}

From source file:org.dataconservancy.ui.it.support.ListProjectCollectionsRequest.java

public HttpPost asHttpPost(String projectId) {

    HttpPost post = null;//from   w  w  w  . j a  v  a2  s  .  c  o m
    try {
        post = new HttpPost(urlConfig.getListProjectCollectionsUrl().toURI());
    } catch (URISyntaxException e) {
        throw new RuntimeException(e.getMessage(), e);
    }

    List<NameValuePair> params = new ArrayList<NameValuePair>();
    params.add(new BasicNameValuePair("currentProjectId", projectId));
    params.add(new BasicNameValuePair(STRIPES_EVENT, "List Project Collections"));

    HttpEntity entity = null;
    try {
        entity = new UrlEncodedFormEntity(params, "UTF-8");
    } catch (UnsupportedEncodingException e) {
        throw new RuntimeException(e.getMessage(), e);
    }

    post.setEntity(entity);

    return post;
}

From source file:com.snaplogic.snaps.uniteller.CustomUFSConfigMgr.java

private CustomUFSConfigMgr(String fileLocation) throws UFSConfigMgrException {
    try {//from   www  .j a  v  a 2  s . c  o m
        URL fileUrl = new URI(fileLocation).toURL();
        this.configProperties = new Properties();
        try (InputStream inputStream = getInputStream(fileUrl)) {
            this.configProperties.load(inputStream);
        }
    } catch (IOException e) {
        log.error(e.getMessage(), e);
        throw new UFSConfigMgrException(e.getMessage());
    } catch (URISyntaxException ex) {
        log.error(ex.getMessage(), ex);
        throw new UFSConfigMgrException(ex.getMessage());
    } finally {
        IOUtils.close(urlConnection);
    }
}

From source file:com.netflix.spinnaker.halyard.config.validate.v1.security.PublicServiceValidator.java

@Override
public void validate(ConfigProblemSetBuilder p, PublicService n) {
    String overrideBaseUrl = n.getOverrideBaseUrl();
    if (!StringUtils.isEmpty(overrideBaseUrl)) {
        try {/*w w  w  . java  2s  . c  om*/
            URI uri = new URIBuilder(overrideBaseUrl).build();

            if (StringUtils.isEmpty(uri.getScheme())) {
                p.addProblem(ERROR, "You must supply a URI scheme, e.g. 'http://' or 'https://'");
            }

            if (StringUtils.isEmpty(uri.getHost())) {
                p.addProblem(ERROR, "You must supply a URI host");
            }
        } catch (URISyntaxException e) {
            p.addProblem(ERROR, "Invalid base URL: " + e.getMessage());
        }
    }
}

From source file:de.kaiserpfalzEdv.office.ui.web.widgets.ImageSource.java

public ImageSource(final String fileName) {
    this.fileName = fileName;
    image = getClass().getClassLoader().getResourceAsStream(fileName);

    LOG.trace("Created: {}", this);
    try {//from  w ww.j  a  v  a  2  s . co  m
        LOG.trace("  from file: {}", getClass().getClassLoader().getResource(fileName).toURI());
    } catch (URISyntaxException e) {
        LOG.error(e.getClass().getSimpleName() + " caught: " + e.getMessage(), e);
    }
}

From source file:org.dataconservancy.ui.it.support.CollectionSplashPageRequest.java

public HttpPost asHttpPost() {

    HttpPost post = null;/*  www. j  a v a2  s .com*/
    try {
        post = new HttpPost(urlConfig.getCollectionSplashUrl().toURI());
    } catch (URISyntaxException e) {
        throw new RuntimeException(e.getMessage(), e);
    }

    List<NameValuePair> params = new ArrayList<NameValuePair>();

    if (null != collectionId) {
        params.add(new BasicNameValuePair("collectionId", collectionId));
    }
    params.add(new BasicNameValuePair(STRIPES_EVENT, "View Collections Details"));

    HttpEntity entity = null;
    try {
        entity = new UrlEncodedFormEntity(params, "UTF-8");
    } catch (UnsupportedEncodingException e) {
        throw new RuntimeException(e.getMessage(), e);
    }

    post.setEntity(entity);

    return post;
}