Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- try {
- jarLocation = CryoStats.class.getProtectionDomain().getCodeSource().getLocation().toURI().getPath();
- confLocation = jarLocation.substring(0, jarLocation.lastIndexOf("/")) + "/config/";
- try (FileInputStream input = new FileInputStream(confLocation + "CryoStats.properties");) {
- properties.load(input);
- HORUS_HOST = properties.getProperty("HORUS_HOST");
- HORUS_USERNAME = properties.getProperty("HORUS_USERNAME");
- HORUS_PASSWORD = properties.getProperty("HORUS_PASSWORD");
- CONNECTION_TIMEOUT = Integer.parseInt(properties.getProperty("CONNECTION_TIMEOUT"));
- SOCKET_TIMEOUT = Integer.parseInt(properties.getProperty("SOCKET_TIMEOUT"));
- System.out.println("CryoStats.properties loaded.");
- } catch (FileNotFoundException ex) {
- System.out.println("Error loading properties file");
- System.out.println(ex.getMessage());
- } catch (IOException ex) {
- System.out.println("Error loading properties file");
- System.out.println(ex.getMessage());
- }
- } catch (URISyntaxException ex) {
- System.out.println(ex.getMessage());
- }
- jarLocation = /cryostats
- confLocation = System.getProperty("user.dir") + "/config/";
Add Comment
Please, Sign In to add comment