From 677b57ccf33b2c213c833960fb8ec944f81d867f Mon Sep 17 00:00:00 2001 From: Björn Hagemeister Date: Wed, 12 Nov 2014 14:59:57 +0100 Subject: Moved proxy configuration file to /opt/openslx/proxy/config and adapted classes therefor. --- .../java/org/openslx/satellitedaemon/Globals.java | 56 +--------------------- 1 file changed, 2 insertions(+), 54 deletions(-) (limited to 'src/main/java/org/openslx/satellitedaemon/Globals.java') diff --git a/src/main/java/org/openslx/satellitedaemon/Globals.java b/src/main/java/org/openslx/satellitedaemon/Globals.java index d75459b..fa39d2d 100644 --- a/src/main/java/org/openslx/satellitedaemon/Globals.java +++ b/src/main/java/org/openslx/satellitedaemon/Globals.java @@ -5,13 +5,8 @@ import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStreamReader; import java.nio.charset.StandardCharsets; -import java.security.KeyFactory; -import java.security.KeyManagementException; import java.security.KeyStore; -import java.security.KeyStoreException; import java.security.NoSuchAlgorithmException; -import java.security.PrivateKey; -import java.security.cert.CertificateException; import java.util.Properties; import javax.net.ssl.SSLContext; @@ -19,7 +14,7 @@ import javax.net.ssl.TrustManager; import javax.net.ssl.TrustManagerFactory; import org.apache.log4j.Logger; -import org.openslx.satellitedaemon.util.Util; +import org.openslx.util.Util; public class Globals { @@ -50,39 +45,14 @@ public class Globals { return properties.getProperty( "IMAGE_FOLDER" ); } - - public static String getProxyConf() - { - return properties.getProperty( "PROXY_CONF" ); - } - - public static String getProxyAddress() - { - return properties.getProperty( "PROXY_ADDR" ); - } - - public static String getProxyUsername() - { - return properties.getProperty( "PROXY_USERNAME" ); - } - - public static String getProxyPassword() - { - return properties.getProperty( "PROXY_PASSWORD" ); - } // Integers // public static int getThriftPort() { - return tryToParseInt( properties.getProperty( "THRIFT_PORT" ) ); + return Util.tryToParseInt( properties.getProperty( "THRIFT_PORT" ) ); } - public static int getProxyPort() - { - return tryToParseInt( properties.getProperty( "PROXY_PORT" ) ); - } - /** * Load properties */ @@ -149,26 +119,4 @@ public class Globals { return context; } - - /** - * Tries to parse an int. Returns 0 on error. - * - * @param s - * The string to parse - * @return The parsed int or 0 on error - */ - public static int tryToParseInt( String s ) - { - try { - return Integer.parseInt( s ); - } catch ( NumberFormatException e ) { - return 0; - } - } - - public static boolean checkProxySettings() { - return ( - (getProxyAddress() != "") && - (getProxyPort() != 0)); - } } -- cgit v1.2.3-55-g7522