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:Main.java

public static void main(String[] args) {
    File aFile;//from  www.  j a v a 2s .  c  o  m
    try {
        aFile = new File(new URI("file:///c:/a.bat"));
        System.out.println(aFile.getName());//false
    } catch (URISyntaxException e) {
        e.printStackTrace();
    }

}

From source file:Main.java

public static void main(String[] args) {
    URI uri = null;//from   w  ww.  ja  v  a 2 s .  c o m
    URL url = null;
    String uriString = "http://www.google.com/";

    try {
        uri = new URI(uriString);
    } catch (URISyntaxException e) {
        e.printStackTrace();
    }

    System.out.println("Original URI  : " + uri);
}

From source file:Main.java

public static void main(String[] a) {
    try {/*w  w  w  .  ja va 2  s. c  om*/
        URI uri = new URI("http://www.java2s.com");
        Desktop desktop = null;
        if (Desktop.isDesktopSupported()) {
            desktop = Desktop.getDesktop();
        }

        if (desktop != null)
            desktop.browse(uri);
    } catch (IOException ioe) {
        ioe.printStackTrace();
    } catch (URISyntaxException use) {
        use.printStackTrace();
    }

}

From source file:Main.java

public static void main(String[] a) {
    try {//ww w. j  a v a2s.co  m
        URI uri = new URI("http://www.java2s.com");
        Desktop desktop = null;
        if (Desktop.isDesktopSupported()) {
            desktop = Desktop.getDesktop();
            desktop.isSupported(Desktop.Action.PRINT);
        }

        if (desktop != null)
            desktop.browse(uri);
    } catch (IOException ioe) {
        ioe.printStackTrace();
    } catch (URISyntaxException use) {
        use.printStackTrace();
    }

}

From source file:com.ccoe.build.alerts.pfdash.PfDashJob.java

/**
 * @param args/*from  w  w  w.  ja v  a2 s.  co  m*/
 */
public static void main(String[] args) {

    PfDashJob job = new PfDashJob();
    File file = null;
    try {
        file = new File(PfDashJob.class.getResource("/").toURI());
        job.run(file);
    } catch (URISyntaxException e) {
        e.printStackTrace();
    }
}

From source file:com.mellanox.jxio.helloworld.HelloClient.java

public static void main(String[] args) {
    if (args.length < 2) {
        usage();/*from ww  w.  jav  a  2s  .c  o  m*/
        return;
    }

    final String serverhostname = args[0];
    final int port = Integer.parseInt(args[1]);

    URI uri = null;
    try {
        uri = new URI("rdma://" + serverhostname + ":" + port + "/");
    } catch (URISyntaxException e) {
        e.printStackTrace();
        return;
    }

    HelloClient client = new HelloClient();
    client.connect(uri);
    client.run();

    LOG.info("Client is releasing JXIO resources and exiting");
    client.releaseResources();
    System.exit(client.exitStatus);
}

From source file:com.mellanox.jxio.helloworld.HelloServer.java

public static void main(String[] args) {
    if (args.length < 2) {
        usage();//from w  w w .ja  va  2  s .co  m
        return;
    }

    final String serverhostname = args[0];
    final int port = Integer.parseInt(args[1]);

    URI uri = null;
    try {
        uri = new URI("rdma://" + serverhostname + ":" + port + "/");
    } catch (URISyntaxException e) {
        e.printStackTrace();
        return;
    }

    HelloServer server = new HelloServer(uri);
    server.run();

    LOG.info("Server is releasing JXIO resources and exiting");
    server.releaseResources();
}

From source file:org.accelio.jxio.simpletest.SimpleServer.java

public static void main(String[] args) {
    if (args.length < 2) {
        usage();/*from  w ww  . j  a  va2 s .c  om*/
        return;
    }

    final String serverhostname = args[0];
    final int port = Integer.parseInt(args[1]);
    if (args.length > 2)
        maxNumberofRsps = Long.parseLong(args[2]);
    if (args.length > 3)
        PRINT_COUNTER = Long.parseLong(args[3]);

    URI uri = null;
    try {
        uri = new URI("rdma://" + serverhostname + ":" + port + "/");
    } catch (URISyntaxException e) {
        e.printStackTrace();
        return;
    }

    SimpleServer server = new SimpleServer(uri);
    server.run();

    LOG.info("Server is releasing JXIO resources and exiting");
    server.releaseResources();
}

From source file:org.accelio.jxio.simpletest.SimpleClient.java

public static void main(String[] args) {
    if (args.length < 2) {
        usage();/*from www.j a  v a 2  s.c  o m*/
        return;
    }

    final String serverhostname = args[0];
    final int port = Integer.parseInt(args[1]);
    if (args.length > 2)
        maxNumberofReqs = Long.parseLong(args[2]);
    if (args.length > 3)
        PRINT_COUNTER = Long.parseLong(args[3]);

    URI uri = null;
    try {
        uri = new URI("rdma://" + serverhostname + ":" + port + "/");
    } catch (URISyntaxException e) {
        e.printStackTrace();
        return;
    }

    SimpleClient client = new SimpleClient();
    // Connect
    client.connect(uri);
    // Wait for a single connection response
    client.run();
    // Send
    for (numberofReqs = 1; numberofReqs <= maxNumberofReqs; ++numberofReqs) {
        LOG.trace("sending req " + numberofReqs);
        client.send();
        client.run();
    }
    // Finish
    LOG.info("Closing the session...");
    client.close();
    LOG.info("Client is releasing JXIO resources and exiting");
    client.releaseResources();
    System.exit(client.exitStatus);
}

From source file:org.accelio.jxio.tests.benchmarks.jxioConnection.StreamClient.java

/**
 * @param args//from   w  w  w .  ja v  a2 s . c om
 */
public static void main(String[] args) {
    String uriString;
    URI uri;
    try {
        LOG.info("arguments = " + args[0] + " " + args[1] + " " + args[2] + " " + args[3] + " " + args[4]);
        ExecutorService es = Executors
                .newFixedThreadPool(Integer.parseInt(args[3]) + Integer.parseInt(args[4]));
        // input
        for (int i = 0; i < Integer.parseInt(args[3]); i++) {
            uriString = String.format("rdma://%s:%s/data?size=%s", args[0], args[1], args[2]);
            uri = new URI(uriString);
            es.submit(new StreamClient(uri, "input", i, Integer.parseInt(args[4])));
        }
        // output
        for (int i = 0; i < Integer.parseInt(args[4]); i++) {
            uriString = String.format("rdma://%s:%s/data?size=%s", args[0], args[1], args[2]);
            uri = new URI(uriString);
            es.submit(new StreamClient(uri, "output", i, Integer.parseInt(args[4])));
        }
        es.shutdown();
        es.awaitTermination(5, TimeUnit.MINUTES);
    } catch (URISyntaxException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (InterruptedException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
}