Class PropertyUtils

java.lang.Object
org.apache.jena.atlas.lib.PropertyUtils

public class PropertyUtils extends Object
  • Constructor Details

    • PropertyUtils

      public PropertyUtils()
  • Method Details

    • loadFromFile

      public static Properties loadFromFile(String filename) throws IOException
      Load properties from a file if the file exists
      Throws:
      IOException
    • loadFromFile

      public static void loadFromFile(Properties properties, String filename) throws IOException
      Load properties from a file if the file exists
      Throws:
      IOException
    • storeToFile

      public static void storeToFile(Properties properties, String comment, String filename) throws IOException
      Throws:
      IOException
    • getPropertyAsInteger

      public static int getPropertyAsInteger(Properties properties, String key)
    • getPropertyAsInteger

      public static int getPropertyAsInteger(Properties properties, String key, int defaultValue)
    • getPropertyAsBoolean

      public static boolean getPropertyAsBoolean(Properties properties, String key, boolean dftValue)
    • getPropertyAsBoolean

      public static Boolean getPropertyAsBoolean(Properties properties, String key)
    • propertyEquals

      public boolean propertyEquals(Properties properties, String key, String value)
      Test whether a property has a value. Null tests equal to not present.
    • ensurePropertySet

      public void ensurePropertySet(Properties properties, String key, String expected)
      Set property if not already set.
    • getOrSetDefault

      public String getOrSetDefault(Properties properties, String key, String expected)
      Get property or the default value - also set the default value if not present
    • checkOrSetProperty

      public void checkOrSetProperty(Properties properties, String key, String expected)
      Check property is an expected value or set if missing
    • checkMetadata

      public void checkMetadata(Properties properties, String key, String expected)
      Check property has the value given - throw exception if not.