Package ghidra.framework
Class ApplicationProperties
- java.lang.Object
-
- java.util.Dictionary<K,V>
-
- java.util.Hashtable<java.lang.Object,java.lang.Object>
-
- java.util.Properties
-
- ghidra.framework.ApplicationProperties
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,java.util.Map<java.lang.Object,java.lang.Object>
public class ApplicationProperties extends java.util.PropertiesThe application properties. Application properties may either be stored on disk, or created dynamically.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringAPPLICATION_GRADLE_VERSION_PROPERTYThe recommended version of gradle used to build the application.static java.lang.StringAPPLICATION_JAVA_COMPILER_PROPERTYThe Java compiler compliance level that was used to build the application.static java.lang.StringAPPLICATION_JAVA_MAX_PROPERTYThe maximum major version of Java the application will run under.static java.lang.StringAPPLICATION_JAVA_MIN_PROPERTYThe minimum major version of Java required to run the application.static java.lang.StringAPPLICATION_LAYOUT_VERSION_PROPERTYThe application's layout version.static java.lang.StringAPPLICATION_NAME_PROPERTYThe application name.static java.lang.StringAPPLICATION_VERSION_PROPERTYThe application version.static java.lang.StringBUILD_DATE_PROPERTYThe date the application was built on, in a long format.static java.lang.StringBUILD_DATE_SHORT_PROPERTYThe date the application was built on, it a short format.static java.lang.StringPROPERTY_FILEThe name of the application properties file.static java.lang.StringRELEASE_MARKING_PROPERTYThe application's release marking.static java.lang.StringRELEASE_NAME_PROPERTYThe application's release name.static java.lang.StringRELEASE_SOURCE_PROPERTYstatic java.lang.StringREVISION_PROPERTY_PREFIXProperty prefix for dynamically generated version control revision number properties.static java.lang.StringTEST_RELEASE_PROPERTY
-
Constructor Summary
Constructors Constructor Description ApplicationProperties(ResourceFile appPropertiesFile)Creates a new application properties from the given application properties file.ApplicationProperties(java.lang.String name)Creates a new application properties with the given name.ApplicationProperties(java.lang.String name, java.lang.String version)Creates a new application properties with the given name and version.ApplicationProperties(java.util.Collection<ResourceFile> applicationRootDirs)Creates a new application properties from the application properties files found in the given application root directories.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ApplicationPropertiesfromFile(java.lang.String filename)Attempts to create an instance of this class by looking for the a properties file with the give name in the current working directory.java.lang.StringgetApplicationBuildDate()Gets the application's build date.java.lang.StringgetApplicationName()Gets the application's name.java.lang.StringgetApplicationVersion()Gets the application's version.java.lang.StringgetProperty(java.lang.String propertyName)Gets the given application property.-
Methods inherited from class java.util.Properties
clear, clone, compute, computeIfAbsent, computeIfPresent, contains, containsKey, containsValue, elements, entrySet, equals, forEach, get, getOrDefault, getProperty, hashCode, isEmpty, keys, keySet, list, list, load, load, loadFromXML, merge, propertyNames, put, putAll, putIfAbsent, rehash, remove, remove, replace, replace, replaceAll, save, setProperty, size, store, store, storeToXML, storeToXML, storeToXML, stringPropertyNames, toString, values
-
-
-
-
Field Detail
-
PROPERTY_FILE
public static final java.lang.String PROPERTY_FILE
The name of the application properties file.- See Also:
- Constant Field Values
-
APPLICATION_NAME_PROPERTY
public static final java.lang.String APPLICATION_NAME_PROPERTY
The application name. For example, "Ghidra".- See Also:
- Constant Field Values
-
APPLICATION_VERSION_PROPERTY
public static final java.lang.String APPLICATION_VERSION_PROPERTY
The application version. For example, "7.4.2".- See Also:
ApplicationVersion, Constant Field Values
-
APPLICATION_LAYOUT_VERSION_PROPERTY
public static final java.lang.String APPLICATION_LAYOUT_VERSION_PROPERTY
The application's layout version. The layout version should get incremented any time something changes about the application that could affect external tools that need to navigate the application in some way (such as the Eclipse GhidraDev plugin). For example, "1".- See Also:
- Constant Field Values
-
APPLICATION_GRADLE_VERSION_PROPERTY
public static final java.lang.String APPLICATION_GRADLE_VERSION_PROPERTY
The recommended version of gradle used to build the application.- See Also:
- Constant Field Values
-
APPLICATION_JAVA_MIN_PROPERTY
public static final java.lang.String APPLICATION_JAVA_MIN_PROPERTY
The minimum major version of Java required to run the application. For example, "8".- See Also:
- Constant Field Values
-
APPLICATION_JAVA_MAX_PROPERTY
public static final java.lang.String APPLICATION_JAVA_MAX_PROPERTY
The maximum major version of Java the application will run under. For example, "8".If all versions of Java greater than
APPLICATION_JAVA_MIN_PROPERTYare supported, this property should not be set.- See Also:
- Constant Field Values
-
APPLICATION_JAVA_COMPILER_PROPERTY
public static final java.lang.String APPLICATION_JAVA_COMPILER_PROPERTY
The Java compiler compliance level that was used to build the application. For example, "1.8".- See Also:
- Constant Field Values
-
BUILD_DATE_PROPERTY
public static final java.lang.String BUILD_DATE_PROPERTY
The date the application was built on, in a long format. For example, "2018-Jan-11 1346 EST".- See Also:
- Constant Field Values
-
BUILD_DATE_SHORT_PROPERTY
public static final java.lang.String BUILD_DATE_SHORT_PROPERTY
The date the application was built on, it a short format. For example, "20180111".- See Also:
- Constant Field Values
-
RELEASE_NAME_PROPERTY
public static final java.lang.String RELEASE_NAME_PROPERTY
The application's release name. For example, "U".- See Also:
- Constant Field Values
-
RELEASE_MARKING_PROPERTY
public static final java.lang.String RELEASE_MARKING_PROPERTY
The application's release marking.- See Also:
- Constant Field Values
-
REVISION_PROPERTY_PREFIX
public static final java.lang.String REVISION_PROPERTY_PREFIX
Property prefix for dynamically generated version control revision number properties.- See Also:
- Constant Field Values
-
TEST_RELEASE_PROPERTY
public static final java.lang.String TEST_RELEASE_PROPERTY
- See Also:
- Constant Field Values
-
RELEASE_SOURCE_PROPERTY
public static final java.lang.String RELEASE_SOURCE_PROPERTY
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ApplicationProperties
public ApplicationProperties(java.lang.String name)
Creates a new application properties with the given name. Additional properties may be set withProperties.setProperty(java.lang.String, java.lang.String).- Parameters:
name- The application's name.
-
ApplicationProperties
public ApplicationProperties(java.lang.String name, java.lang.String version)Creates a new application properties with the given name and version. Additional properties may be set withProperties.setProperty(java.lang.String, java.lang.String).- Parameters:
name- The application's name.version- The application's version.
-
ApplicationProperties
public ApplicationProperties(ResourceFile appPropertiesFile) throws java.io.IOException
Creates a new application properties from the given application properties file.- Parameters:
appPropertiesFile- The application properties file.- Throws:
java.io.IOException- If there was a problem loading/reading a discovered properties file.
-
ApplicationProperties
public ApplicationProperties(java.util.Collection<ResourceFile> applicationRootDirs) throws java.io.IOException
Creates a new application properties from the application properties files found in the given application root directories. If multiple application properties files are found, the properties from the files will be combined. If duplicate keys exist, the newest key encountered will overwrite the existing key.- Parameters:
applicationRootDirs- The application root directories to look for the properties files in.- Throws:
java.io.IOException- If there was a problem loading/reading a discovered properties file.
-
-
Method Detail
-
fromFile
public static ApplicationProperties fromFile(java.lang.String filename) throws java.io.IOException
Attempts to create an instance of this class by looking for the a properties file with the give name in the current working directory.- Parameters:
filename- the name of the properties file to load- Returns:
- the new instance of this class created from the properties file on disk
- Throws:
java.io.IOException- if there is no properties file found in the expected location
-
getProperty
public java.lang.String getProperty(java.lang.String propertyName)
Gets the given application property. Note that if the specified property is defined as a system property, the system property will be given precedence and returned.- Overrides:
getPropertyin classjava.util.Properties- Parameters:
propertyName- The property name to get.- Returns:
- The property.
-
getApplicationName
public java.lang.String getApplicationName()
Gets the application's name.- Returns:
- The application's name.
-
getApplicationVersion
public java.lang.String getApplicationVersion()
Gets the application's version.- Returns:
- The application's version.
-
getApplicationBuildDate
public java.lang.String getApplicationBuildDate()
Gets the application's build date.- Returns:
- The application's build date.
-
-