Example usage for java.net URISyntaxException printStackTrace

List of usage examples for java.net URISyntaxException printStackTrace

Introduction

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

Prototype

public void printStackTrace() 

Source Link

Document

Prints this throwable and its backtrace to the standard error stream.

Usage

From source file:eu.optimis.vmmanager.rest.client.VMManagerRESTClient.java

/**
 * Used to get the location of a given VM
 * @returns location/*w  w w .ja v  a 2s. c  o  m*/
 */
public String getLocation(String vmId) {
    String resp = null;
    try {
        if (vmId != null) {
            WebResource resource = client.resource(this.getAddress()).path("/compute/location")
                    .queryParam("vmid", vmId);
            resp = resource.type(MediaType.TEXT_PLAIN).accept(MediaType.TEXT_PLAIN).get(String.class);
        }
    } catch (URISyntaxException e) {
        e.printStackTrace();
    }
    return resp;
}

From source file:org.rifidi.designer.library.basemodels.cardbox.CardboxEntity.java

@Override
public void loaded() {
    if (model == null) {
        try {//w  w  w .  j  a v  a 2  s  . c  o  m
            URI modelpath = getClass().getClassLoader()
                    .getResource("org/rifidi/designer/library/basemodels/cardbox/cardboardbox.jme").toURI();
            model = (Node) BinaryImporter.getInstance().load(modelpath.toURL());
        } catch (URISyntaxException e) {
            e.printStackTrace();
        } catch (IOException e) {
            logger.error("Unable to load jme: " + e);
        }
    }
}

From source file:eu.optimis.vmmanager.rest.client.VMManagerRESTClient.java

/**
 * It allows removing an already created VM
 *//*from   w  w  w  . ja  v  a2  s .  c  o m*/
public synchronized void removeVM(String vmId) throws VRMMSchedulerException {
    try {
        if (vmId != null) {
            WebResource resource = client.resource(this.getAddress());
            resource.path("compute").path(vmId).delete();
        }
    } catch (UniformInterfaceException ex) {
        ClientResponse cr = ex.getResponse();
        cr.getStatus();
        ex.printStackTrace();
    } catch (URISyntaxException e) {
        e.printStackTrace();
    }
}

From source file:com.microsoft.office.sfb.healthcare.SkypeCall.java

/**
 * Connect to an existing Skype for Business meeting with the URI you get
 * from a server-side UCWA-based web service.
 *///from   w  w  w  . j a va 2  s . c  om
private Conversation startToJoinMeeting() {
    URI meetingURI = null;
    Conversation conversation = null;
    try {
        meetingURI = new URI(getString(R.string.meeting_url));
    } catch (URISyntaxException e) {
        e.printStackTrace();
    }
    try {

        mApplication = Application.getInstance(this);
        mApplication.getConfigurationManager().enablePreviewFeatures(true);
        anonymousSession = mApplication.joinMeetingAnonymously(getString(R.string.userDisplayName), meetingURI);
        conversation = anonymousSession.getConversation();
    } catch (SFBException e) {
        e.printStackTrace();
    }
    return conversation;
}

From source file:org.megam.deccanplato.provider.box.handler.UserImpl.java

/**
 * @return/*from   w w w  .  j a v  a2s. c  o m*/
 */
private Map<String, String> list() {
    Map<String, String> outMap = new HashMap<>();
    final String BOX_UPLOAD = "/users";

    Map<String, String> headerMap = new HashMap<String, String>();
    headerMap.put("Authorization", "BoxAuth api_key=" + args.get(API_KEY) + "&auth_token=" + args.get(TOKEN));

    TransportTools tools = new TransportTools(BOX_URI + BOX_UPLOAD, null, headerMap);
    String responseBody = null;
    TransportResponse response = null;
    try {
        response = TransportMachinery.get(tools);
        responseBody = response.entityToString();
        System.out.println("OUTPUT:" + responseBody);
    } catch (ClientProtocolException ce) {
        ce.printStackTrace();
    } catch (IOException ioe) {
        ioe.printStackTrace();
    } catch (URISyntaxException e) {
        e.printStackTrace();
    }
    outMap.put(OUTPUT, responseBody);
    return outMap;
}

From source file:teletype.model.vk.Auth.java

private URI getUri(URIBuilder uriBuilder) {
    URI uri = null;/*from w  w w .  ja v  a  2s.com*/
    try {
        uri = uriBuilder.build();
    } catch (URISyntaxException e) {
        e.printStackTrace();
    }
    return uri;
}

From source file:com.squid.kraken.v4.auth.ChangePasswordServlet.java

@Override
protected void service(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
    String password = request.getParameter("password");
    if (password != null) {
        try {//from   ww w. ja  va2s  .  c o m
            proceed(request, response);
        } catch (URISyntaxException e) {
            e.printStackTrace();
            show(request, response);
        }
    } else {
        // forward to page
        show(request, response);
    }
}

From source file:gr.ntua.ivml.awareness.search.SearchServiceAccess.java

private URI constructURI(List<String> terms, String type, int startPage) {
    URI uri = null;/*from  ww  w  .j av  a  2s .c  om*/
    String delim = "+";
    Iterator<String> it = terms.iterator();
    String q = "";
    if (it.hasNext()) {
        q = "\"" + it.next() + "\"";
    }
    while (it.hasNext()) {
        q += delim + "\"" + it.next() + "\"";
    }
    List<NameValuePair> qparams = new ArrayList<NameValuePair>();
    qparams.add(new BasicNameValuePair("query", q));
    if (type != null && type.length() > 0) {
        qparams.add(new BasicNameValuePair("qf", "TYPE:" + type.toUpperCase()));
    }
    qparams.add(new BasicNameValuePair("profile", "standard"));

    if (startPage == 0)
        qparams.add(new BasicNameValuePair("start", "1"));
    else
        qparams.add(new BasicNameValuePair("start", Integer.toString(startPage * 6)));
    qparams.add(new BasicNameValuePair("rows", "6"));
    qparams.add(new BasicNameValuePair("wskey", "api2demo"));
    try {
        uri = URIUtils.createURI("http", "preview.europeana.eu", 80, "/api/v2/search.json",
                URLEncodedUtils.format(qparams, "UTF-8"), null);
    } catch (URISyntaxException e) {
        e.printStackTrace();
    }
    return uri;
}

From source file:it.txt.ens.core.impl.test.BasicENSResourceTest.java

private void testURI(ENSResource resource) {
    URIBuilder uriBuilder = new URIBuilder();
    uriBuilder.addParameter(ENSResource.NAMESPACE_PARAMETER_NAME, resource.getNamespace());
    uriBuilder.addParameter(ENSResource.PATTERN_PARAMETER_NAME, resource.getPattern());
    uriBuilder.setHost(resource.getHost());
    uriBuilder.setPath(resource.getPath());
    uriBuilder.setScheme(ENSResource.URI_SCHEME);

    try {/*from  w  w  w .j a  va2s .  c  om*/
        assertEquals("Unexpected resourceURI", uriBuilder.build(), resource.getURI());
    } catch (URISyntaxException e) {
        fail(e.getMessage());
        e.printStackTrace();
    }
}

From source file:com.yoavst.quickapps.news.LoginActivity.java

void handleUrl(String url) {
    try {// w ww.j a  v  a  2s. c  o  m
        URI uri = new URI(url);
        List<NameValuePair> parameters = URLEncodedUtils.parse(uri, "UTF-8");
        for (NameValuePair pair : parameters) {
            if (pair.getName().equals("error")) {
                handleLoginError("Error: " + pair.getValue());
                return;
            } else if (pair.getName().equals("code")) {
                handleCode(pair.getValue());
                return;
            }
        }
        handleLoginError("Error! please try again");
    } catch (URISyntaxException e) {
        // Impossible, I think
        e.printStackTrace();
    }
}