Example usage for java.lang System getProperties

List of usage examples for java.lang System getProperties

Introduction

In this page you can find the example usage for java.lang System getProperties.

Prototype

public static Properties getProperties() 

Source Link

Document

Determines the current system properties.

Usage

From source file:ServerMultipart.java

public static void main(String... args) {

    String privateKeyPath = "PATH/.ssh/id_rsa";
    String publicKeyId = "04:92:7b:23:bc:08:4f:d7:3b:5a:38:9e:4a:17:2e:df";
    String multipartServer = "https://MANTA_MULTIPART_SERVER";

    ConfigContext config = new ChainedConfigContext(new DefaultsConfigContext(), new EnvVarConfigContext(),
            new MapConfigContext(System.getProperties())).setMantaURL(multipartServer)
                    .setMantaUser(mantaUsername).setMantaKeyPath(privateKeyPath).setMantaKeyId(publicKeyId);

    try (MantaClient client = new MantaClient(config)) {
        ServerSideMultipartManager multipart = new ServerSideMultipartManager(client);
        multipartUpload(multipart);/*from w  ww .  j  av  a 2  s .c  om*/
    }
}

From source file:com.jci.job.Application.java

/**
 * The main method.//from   ww  w.ja va  2 s  . co  m
 *
 * @param args the arguments
 */
public static void main(String[] args) {
    System.getProperties().put("http.proxyHost", "10.10.5.18");
    System.getProperties().put("http.proxyPort", "8080");
    System.getProperties().put("http.proxyUser", "cdubeyar");
    System.getProperties().put("http.proxyPassword", "Arun123");
    SpringApplication.run(Application.class, args);

}

From source file:org.fusesource.cloudmix.tests.consumer.Main.java

public static void main(String[] args) {
    if (args.length > 0 && args[0].equals("-debug")) {
        Map<Object, Object> properties = new TreeMap<Object, Object>();
        properties.putAll(System.getProperties());
        for (Map.Entry<Object, Object> entry : properties.entrySet()) {
            System.out.println(" " + entry.getKey() + " = " + entry.getValue());
        }//from  ww w  .jav a 2s  .c  o m
    }

    ClassPathXmlApplicationContext applicationContext = new ClassPathXmlApplicationContext(
            "META-INF/spring/context.xml");
    applicationContext.start();

    System.out.println("Enter quit to stop");

    try {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        while (true) {
            String line = reader.readLine();
            if (line == null || line.trim().equalsIgnoreCase("quit")) {
                break;
            }
        }
    } catch (IOException e) {
        System.err.println("Caught: " + e);
        e.printStackTrace(System.err);
    }

    applicationContext.close();
}

From source file:org.fusesource.cloudmix.tests.broker.Main.java

public static void main(String[] args) {
    if (verbose || (args.length > 0 && args[0].equals("-debug"))) {
        Map<Object, Object> properties = new TreeMap<Object, Object>();
        properties.putAll(System.getProperties());
        for (Map.Entry<Object, Object> entry : properties.entrySet()) {
            System.out.println(" " + entry.getKey() + " = " + entry.getValue());
        }//  w  w  w .j a  v  a  2  s.c  om
    }

    ClassPathXmlApplicationContext applicationContext = new ClassPathXmlApplicationContext(
            "META-INF/spring/activemq.xml");
    applicationContext.start();

    System.out.println("Enter quit to stop");

    try {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        while (true) {
            String line = reader.readLine();
            if (line == null || line.trim().equalsIgnoreCase("quit")) {
                break;
            }
        }
    } catch (IOException e) {
        System.err.println("Caught: " + e);
        e.printStackTrace(System.err);
    }

    applicationContext.close();
}

From source file:ClientEncryptionServerMultipart.java

public static void main(String... args) {

    String privateKeyPath = "PATH/.ssh/id_rsa";
    String publicKeyId = "04:92:7b:23:bc:08:4f:d7:3b:5a:38:9e:4a:17:2e:df";
    String multipartServer = "https://MANTA_MULTIPART_SERVER";

    ConfigContext config = new ChainedConfigContext(new DefaultsConfigContext(), new EnvVarConfigContext(),
            new MapConfigContext(System.getProperties())).setMantaURL(multipartServer)
                    .setMantaUser(mantaUsername).setMantaKeyPath(privateKeyPath).setMantaKeyId(publicKeyId)
                    .setClientEncryptionEnabled(true).setEncryptionAlgorithm("AES256/CTR/NoPadding")
                    .setEncryptionAuthenticationMode(EncryptionAuthenticationMode.Optional)
                    .setPermitUnencryptedDownloads(false).setEncryptionKeyId("simple/example")
                    .setEncryptionPrivateKeyBytes(
                            Base64.getDecoder().decode("RkZGRkZGRkJEOTY3ODNDNkM5MUUyMjIyMTExMTIyMjI="));

    try (MantaClient client = new MantaClient(config)) {
        EncryptedServerSideMultipartManager multipart = new EncryptedServerSideMultipartManager(client);
        multipartUpload(multipart);//from w w w  . j  a va  2  s .  c om
    }
}

From source file:com.pinterest.terrapin.server.TerrapinServerMain.java

public static void main(String[] args) {
    PropertiesConfiguration configuration = TerrapinUtil.readPropertiesExitOnFailure(
            System.getProperties().getProperty("terrapin.config", "server.properties"));

    try {/*from w w  w.ja v  a 2  s.c  o m*/
        final TerrapinServerHandler handler = new TerrapinServerHandler(configuration);
        handler.start();
        Runtime.getRuntime().addShutdownHook(new Thread() {
            @Override
            public void run() {
                handler.shutdown();
            }
        });
    } catch (Throwable t) {
        LOG.error("Could not start up server.", t);
        System.exit(1);
    }
}

From source file:com.pinterest.terrapin.controller.TerrapinControllerMain.java

public static void main(String[] args) {
    PropertiesConfiguration configuration = TerrapinUtil.readPropertiesExitOnFailure(
            System.getProperties().getProperty("terrapin.config", "controller.properties"));
    try {/*from w w  w . j a  v  a2 s  .co  m*/
        LOG.info("Starting controller.");
        final TerrapinControllerHandler handler = new TerrapinControllerHandler(configuration);
        handler.start();

        Runtime.getRuntime().addShutdownHook(new Thread() {
            @Override
            public void run() {
                handler.shutdown();
            }
        });
    } catch (Throwable t) {
        LOG.error("Could not start the controller.", t);
    }
}

From source file:dualcontrol.CryptoClientDemo.java

public static void main(String[] args) throws Exception {
    if (args.length != 3) {
        System.err.println("CryptoClientDemo usage: hostAddress port text");
    } else {/*  w  w  w.j a v  a 2 s  . c om*/
        new CryptoClientDemo().call(System.getProperties(), new MockableConsoleAdapter(System.console()),
                args[0], Integer.parseInt(args[1]), args[2].getBytes());
    }
}

From source file:com.jointhegrid.ironcount.user.IroncountCli.java

public static void main(String[] args) throws Exception {
    properties = System.getProperties();
    if (properties.get(WorkloadManager.ZK_SERVER_LIST) == null) {
        logger.warn(WorkloadManager.ZK_SERVER_LIST + " was not defined setting to localhost:2181");
        properties.setProperty(WorkloadManager.ZK_SERVER_LIST, "localhost:2181");
    }//from   w  w w  . j a  va  2  s.c o  m
    workloadManager = new WorkloadManager(properties);
    // TODO parse & apply parameters from CLI
    // TODO push through config properties file
    IroncountCli ic = new IroncountCli();

    //ic.doExecute();

    logger.warn("starting console reader");
    ConsoleReader reader = new ConsoleReader();

    String line;
    while ((line = reader.readLine("[ironcount] ")) != null) {
        if (line.equalsIgnoreCase("exit")) {
            System.exit(0);
        } else if (line.equalsIgnoreCase("stop")) {
            reader.printString("Stopping ironcount workload manager...");
            workloadManager.shutdown();
            reader.printString("Stopped. \n");
        } else if (line.equalsIgnoreCase("start")) {
            reader.printString("Starting ironcount workload manager...");
            workloadManager.init();
            reader.printString("OK \n");
        }
        processArgs(line.split(" "), reader);
    }
}

From source file:Main.java

public static void main(String args[]) {
    JFrame frame = new JFrame("Custom Tip Demo");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    Properties props = System.getProperties();
    Main list = new Main(props);
    JScrollPane scrollPane = new JScrollPane(list);
    frame.add(scrollPane);/* w w  w . j a v a2s  .  c o m*/
    frame.setSize(300, 300);
    frame.setVisible(true);
}