Package org.apache.jena.atlas.lib
Class PropertyUtils
- java.lang.Object
-
- org.apache.jena.atlas.lib.PropertyUtils
-
public class PropertyUtils extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description PropertyUtils()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheckMetadata(java.util.Properties properties, java.lang.String key, java.lang.String expected)Check property has the value given - throw exception if not.voidcheckOrSetProperty(java.util.Properties properties, java.lang.String key, java.lang.String expected)Check property is an expected value or set if missingvoidensurePropertySet(java.util.Properties properties, java.lang.String key, java.lang.String expected)Set property if not already set.java.lang.StringgetOrSetDefault(java.util.Properties properties, java.lang.String key, java.lang.String expected)Get property or the default value - also set the default value if not presentstatic java.lang.BooleangetPropertyAsBoolean(java.util.Properties properties, java.lang.String key)static booleangetPropertyAsBoolean(java.util.Properties properties, java.lang.String key, boolean dftValue)static intgetPropertyAsInteger(java.util.Properties properties, java.lang.String key)static intgetPropertyAsInteger(java.util.Properties properties, java.lang.String key, int defaultValue)static java.util.PropertiesloadFromFile(java.lang.String filename)Load properties from a file if the file existsstatic voidloadFromFile(java.util.Properties properties, java.lang.String filename)Load properties from a file if the file existsbooleanpropertyEquals(java.util.Properties properties, java.lang.String key, java.lang.String value)Test whether a property has a value.static voidstoreToFile(java.util.Properties properties, java.lang.String comment, java.lang.String filename)
-
-
-
Method Detail
-
loadFromFile
public static java.util.Properties loadFromFile(java.lang.String filename) throws java.io.IOExceptionLoad properties from a file if the file exists- Throws:
java.io.IOException
-
loadFromFile
public static void loadFromFile(java.util.Properties properties, java.lang.String filename) throws java.io.IOExceptionLoad properties from a file if the file exists- Throws:
java.io.IOException
-
storeToFile
public static void storeToFile(java.util.Properties properties, java.lang.String comment, java.lang.String filename) throws java.io.IOException- Throws:
java.io.IOException
-
getPropertyAsInteger
public static int getPropertyAsInteger(java.util.Properties properties, java.lang.String key)
-
getPropertyAsInteger
public static int getPropertyAsInteger(java.util.Properties properties, java.lang.String key, int defaultValue)
-
getPropertyAsBoolean
public static boolean getPropertyAsBoolean(java.util.Properties properties, java.lang.String key, boolean dftValue)
-
getPropertyAsBoolean
public static java.lang.Boolean getPropertyAsBoolean(java.util.Properties properties, java.lang.String key)
-
propertyEquals
public boolean propertyEquals(java.util.Properties properties, java.lang.String key, java.lang.String value)Test whether a property has a value. Null tests equal to not present.
-
ensurePropertySet
public void ensurePropertySet(java.util.Properties properties, java.lang.String key, java.lang.String expected)Set property if not already set.
-
getOrSetDefault
public java.lang.String getOrSetDefault(java.util.Properties properties, java.lang.String key, java.lang.String expected)Get property or the default value - also set the default value if not present
-
checkOrSetProperty
public void checkOrSetProperty(java.util.Properties properties, java.lang.String key, java.lang.String expected)Check property is an expected value or set if missing
-
checkMetadata
public void checkMetadata(java.util.Properties properties, java.lang.String key, java.lang.String expected)Check property has the value given - throw exception if not.
-
-