Package org.spdx

Class Configuration

java.lang.Object
org.spdx.Configuration

public final class Configuration extends Object
The configuration class for the Spdx-Java-Library. When a caller attempts to retrieve a configuration property, it will first be checked in the Java system properties (i.e. set via `-D` command line options to the JVM, or by programmatic calls to `System.setProperty()` in code), and will then fallback on a properties file in the classpath. That file must be called `/resources/spdx-java-library.properties`. Please see the documentation for specifics on what configuration options Spdx-Java-Library supports, and how they impact the library's behavior.
  • Method Details

    • getInstance

      public static Configuration getInstance()
      Returns:
      The singleton instance of the Configuration class.
    • getProperty

      public String getProperty(String propertyName)
      Parameters:
      propertyName - The name of the configuration property to retrieve.
      Returns:
      The value of the given property name, or null if it wasn't found.
    • getProperty

      public String getProperty(String propertyName, String defaultValue)
      Parameters:
      propertyName - The name of the configuration property to retrieve.
      defaultValue - The default value to return, if the property isn't found.
      Returns:
      The value of the given property name, or defaultValue if it wasn't found.