/** * Get a module configuration property as a long * * @param module the name of the module * @param property the name of the property * @return the value of the property. <code>0</code> is returned if the * property does not exist. To differentiate between this case and * when the property actually is zero, use <code>getProperty</code>. */ public static long getLongProperty(String module, String property) { if (module == null) { return getLongProperty(property); } // Assume "module" properties are always prefixed with the module name return getLongProperty(module + "." + property); }
/** * Get a configuration property as an long, with default * * @param module the module, or <code>null</code> for regular property * @param property the name of the property * @param defaultValue value to return if property is not found or is not a Long. * @return the value of the property. <code>default</code> is returned if * the property does not exist or is not an Integer. To differentiate between this case * and when the property actually is false, use * <code>getProperty</code>. */ public static long getLongProperty(String module, String property, int defaultValue) { if (module == null) { return getLongProperty(property, defaultValue); } // Assume "module" properties are always prefixed with the module name return getLongProperty(module + "." + property, defaultValue); }
/** * Generate the cache validity object. * */ public SourceValidity getValidity() { if (this.validity == null) { long expiry = System.currentTimeMillis() + ConfigurationManager.getLongProperty("websvc.opensearch.validity") * 60 * 60 * 1000; this.validity = new ExpiresValidity(expiry); } return this.validity; }
long maxSize = ConfigurationManager.getLongProperty("upload.max");