public static double getPropertyNumber(String resource, String name) { String str = getPropertyValue(resource, name); double strValue = 0.00000; try { strValue = Double.parseDouble(str); } catch (NumberFormatException nfe) {} return strValue; }
public static double getPropertyNumber(URL url, String name) { String str = getPropertyValue(url, name); double strValue = 0.00000; try { strValue = Double.parseDouble(str); } catch (NumberFormatException nfe) {} return strValue; }
public static double getPropertyNumber(URL url, String name) { String str = getPropertyValue(url, name); double strValue = 0.00000; try { strValue = Double.parseDouble(str); } catch (NumberFormatException nfe) {} return strValue; }
public static double getPropertyNumber(String resource, String name) { String str = getPropertyValue(resource, name); double strValue = 0.00000; try { strValue = Double.parseDouble(str); } catch (NumberFormatException nfe) {} return strValue; }
/** Returns the value of the specified property name from the specified resource/properties file. * If the specified property name or properties file is not found, the defaultValue is returned. * @param resource The name of the resource - if the properties file is 'webevent.properties', the resource name is 'webevent' * @param name The name of the property in the properties file * @param defaultValue The value to return if the property is not found * @return The value of the property in the properties file, or if not found then the defaultValue */ public static String getPropertyValue(String resource, String name, String defaultValue) { String value = getPropertyValue(resource, name); if (value == null || value.length() == 0) return defaultValue; else return value; }
/** Returns the value of the specified property name from the specified resource/properties file. * If the specified property name or properties file is not found, the defaultValue is returned. * @param resource The name of the resource - if the properties file is 'webevent.properties', the resource name is 'webevent' * @param name The name of the property in the properties file * @param defaultValue The value to return if the property is not found * @return The value of the property in the properties file, or if not found then the defaultValue */ public static String getPropertyValue(String resource, String name, String defaultValue) { String value = getPropertyValue(resource, name); if (value == null || value.length() == 0) return defaultValue; else return value; }
/** Returns the value of the specified property name from the specified resource/properties file. * If the specified property name or properties file is not found, the defaultValue is returned. * @param url URL object specifying the location of the resource * @param name The name of the property in the properties file * @param defaultValue The value to return if the property is not found * @return The value of the property in the properties file, or if not found then the defaultValue */ public static String getPropertyValue(URL url, String name, String defaultValue) { String value = getPropertyValue(url, name); if (value == null || value.length() <= 0) return defaultValue; else return value; }
/** Compares the specified property to the compareString, returns true if they are the same, false otherwise * @param url URL object specifying the location of the resource * @param name The name of the property in the properties file * @param compareString The String to compare the property value to * @return True if the strings are the same, false otherwise */ public static boolean propertyValueEquals(URL url, String name, String compareString) { String value = getPropertyValue(url, name); if (value == null) return false; return value.trim().equals(compareString); }
/** Returns the value of the specified property name from the specified resource/properties file. * If the specified property name or properties file is not found, the defaultValue is returned. * @param url URL object specifying the location of the resource * @param name The name of the property in the properties file * @param defaultValue The value to return if the property is not found * @return The value of the property in the properties file, or if not found then the defaultValue */ public static String getPropertyValue(URL url, String name, String defaultValue) { String value = getPropertyValue(url, name); if (value == null || value.length() <= 0) return defaultValue; else return value; }
/** Compares the specified property to the compareString, returns true if they are the same, false otherwise * @param resource The name of the resource - if the properties file is 'webevent.properties', the resource name is 'webevent' * @param name The name of the property in the properties file * @param compareString The String to compare the property value to * @return True if the strings are the same, false otherwise */ public static boolean propertyValueEquals(String resource, String name, String compareString) { String value = getPropertyValue(resource, name); if (value == null) return false; return value.trim().equals(compareString); }
/** Compares Ignoring Case the specified property to the compareString, returns true if they are the same, false otherwise * @param url URL object specifying the location of the resource * @param name The name of the property in the properties file * @param compareString The String to compare the property value to * @return True if the strings are the same, false otherwise */ public static boolean propertyValueEqualsIgnoreCase(URL url, String name, String compareString) { String value = getPropertyValue(url, name); if (value == null) return false; return value.trim().equalsIgnoreCase(compareString); }
/** Compares Ignoring Case the specified property to the compareString, returns true if they are the same, false otherwise * @param url URL object specifying the location of the resource * @param name The name of the property in the properties file * @param compareString The String to compare the property value to * @return True if the strings are the same, false otherwise */ public static boolean propertyValueEqualsIgnoreCase(URL url, String name, String compareString) { String value = getPropertyValue(url, name); if (value == null) return false; return value.trim().equalsIgnoreCase(compareString); }
/** Compares Ignoring Case the specified property to the compareString, returns true if they are the same, false otherwise * @param resource The name of the resource - if the properties file is 'webevent.properties', the resource name is 'webevent' * @param name The name of the property in the properties file * @param compareString The String to compare the property value to * @return True if the strings are the same, false otherwise */ public static boolean propertyValueEqualsIgnoreCase(String resource, String name, String compareString) { String value = getPropertyValue(resource, name); if (value == null) return false; return value.trim().equalsIgnoreCase(compareString); }
/** Compares the specified property to the compareString, returns true if they are the same, false otherwise * @param url URL object specifying the location of the resource * @param name The name of the property in the properties file * @param compareString The String to compare the property value to * @return True if the strings are the same, false otherwise */ public static boolean propertyValueEquals(URL url, String name, String compareString) { String value = getPropertyValue(url, name); if (value == null) return false; return value.trim().equals(compareString); }
/** Compares the specified property to the compareString, returns true if they are the same, false otherwise * @param resource The name of the resource - if the properties file is 'webevent.properties', the resource name is 'webevent' * @param name The name of the property in the properties file * @param compareString The String to compare the property value to * @return True if the strings are the same, false otherwise */ public static boolean propertyValueEquals(String resource, String name, String compareString) { String value = getPropertyValue(resource, name); if (value == null) return false; return value.trim().equals(compareString); }
/** Compares Ignoring Case the specified property to the compareString, returns true if they are the same, false otherwise * @param resource The name of the resource - if the properties file is 'webevent.properties', the resource name is 'webevent' * @param name The name of the property in the properties file * @param compareString The String to compare the property value to * @return True if the strings are the same, false otherwise */ public static boolean propertyValueEqualsIgnoreCase(String resource, String name, String compareString) { String value = getPropertyValue(resource, name); if (value == null) return false; return value.trim().equalsIgnoreCase(compareString); }
private InputStream sendHttpRequestStream(String method) throws HttpClientException { String protocol = UtilProperties.getPropertyValue("jsse.properties", "java.protocol.handler.pkgs", "NONE"); String proxyHost = UtilProperties.getPropertyValue("jsse.properties", "https.proxyHost", "NONE"); String proxyPort = UtilProperties.getPropertyValue("jsse.properties", "https.proxyPort", "NONE"); String cypher = UtilProperties.getPropertyValue("jsse.properties", "https.cipherSuites", "NONE"); if (protocol != null && !protocol.equals("NONE")) System.setProperty("java.protocol.handler.pkgs", protocol);
private void createHttpMethod(String method) throws HttpClientException, HttpException, IOException { String protocol = UtilProperties.getPropertyValue("jsse.properties", "java.protocol.handler.pkgs", "NONE"); String proxyHost = UtilProperties.getPropertyValue("jsse.properties", "https.proxyHost", "NONE"); String proxyPort = UtilProperties.getPropertyValue("jsse.properties", "https.proxyPort", "NONE"); String cypher = UtilProperties.getPropertyValue("jsse.properties", "https.cipherSuites", "NONE"); if (protocol != null && !protocol.equals("NONE")) System.setProperty("java.protocol.handler.pkgs", protocol);