Package ghidra.framework
Class ApplicationProperties
- All Implemented Interfaces:
Serializable
,Cloneable
,Map<Object,
Object>
The application properties. Application properties may either be stored on disk, or created
dynamically.
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The earliest version of gradle afterAPPLICATION_GRADLE_MIN_PROPERTY
that is unsupported.static final String
The minimum version of gradle required to build the application.static final String
The Java compiler compliance level that was used to build the application.static final String
The maximum major version of Java the application will run under.static final String
The minimum major version of Java required to run the application.static final String
The application's layout version.static final String
The application name.static final String
The application version.static final String
The date the application was built on, in a long format.static final String
The date the application was built on, it a short format.static final String
The name of the application properties file.static final String
The application's release marking.static final String
The application's release name.static final String
static final String
Property prefix for dynamically generated version control revision number properties.static final String
Fields inherited from class java.util.Properties
defaults
-
Constructor Summary
ConstructorDescriptionApplicationProperties
(ResourceFile appPropertiesFile) Creates a new application properties from the given application properties file.ApplicationProperties
(String name) Creates a new application properties with the given name.ApplicationProperties
(String name, String version, String releaseName) Creates a new application properties with the given name and version.ApplicationProperties
(Collection<ResourceFile> applicationRootDirs) Creates a new application properties from the application properties files found in the given application root directories. -
Method Summary
Modifier and TypeMethodDescriptionstatic ApplicationProperties
Attempts to create an instance of this class by looking for the a properties file with the give name in the current working directory.Gets the application's build date.Gets the application's name.Gets the application's release name.Gets the application's version.getProperty
(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 Details
-
PROPERTY_FILE
The name of the application properties file.- See Also:
-
APPLICATION_NAME_PROPERTY
The application name. For example, "Ghidra".- See Also:
-
APPLICATION_VERSION_PROPERTY
The application version. For example, "7.4.2".- See Also:
-
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).Current application versions are:
- 1: Layout used by Ghidra < 11.1
- 2: Introduced with Ghidra 11.1. Default user settings/cache/temp directories changed, and XDG environment variables are supported.
- 3: Introduced with Ghidra 11.2. Ghidra no longer finds external modules by examining
the initial classpath. Instead, the "ghidra.external.modules" system property is used
(see
GhidraApplicationLayout
).
- See Also:
-
APPLICATION_GRADLE_MIN_PROPERTY
The minimum version of gradle required to build the application.- See Also:
-
APPLICATION_GRADLE_MAX_PROPERTY
The earliest version of gradle afterAPPLICATION_GRADLE_MIN_PROPERTY
that is unsupported.If all versions of Gradle greater than or equal to
APPLICATION_GRADLE_MIN_PROPERTY
are supported, this property should not be set.- See Also:
-
APPLICATION_JAVA_MIN_PROPERTY
The minimum major version of Java required to run the application.- See Also:
-
APPLICATION_JAVA_MAX_PROPERTY
The maximum major version of Java the application will run under.If all versions of Java greater than or equal to
APPLICATION_JAVA_MIN_PROPERTY
are supported, this property should not be set.- See Also:
-
APPLICATION_JAVA_COMPILER_PROPERTY
The Java compiler compliance level that was used to build the application. For example, "1.8".- See Also:
-
BUILD_DATE_PROPERTY
The date the application was built on, in a long format. For example, "2018-Jan-11 1346 EST".- See Also:
-
BUILD_DATE_SHORT_PROPERTY
The date the application was built on, it a short format. For example, "20180111".- See Also:
-
RELEASE_NAME_PROPERTY
The application's release name. For example, "U".- See Also:
-
RELEASE_MARKING_PROPERTY
The application's release marking.- See Also:
-
REVISION_PROPERTY_PREFIX
Property prefix for dynamically generated version control revision number properties.- See Also:
-
TEST_RELEASE_PROPERTY
- See Also:
-
RELEASE_SOURCE_PROPERTY
- See Also:
-
-
Constructor Details
-
ApplicationProperties
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
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.releaseName
- The application's release name.
-
ApplicationProperties
Creates a new application properties from the given application properties file.- Parameters:
appPropertiesFile
- The application properties file.- Throws:
IOException
- If there was a problem loading/reading a discovered properties file.
-
ApplicationProperties
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:
IOException
- If there was a problem loading/reading a discovered properties file.
-
-
Method Details
-
fromFile
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:
IOException
- if there is no properties file found in the expected location
-
getProperty
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:
getProperty
in classProperties
- Parameters:
propertyName
- The property name to get.- Returns:
- The property.
-
getApplicationName
Gets the application's name.- Returns:
- The application's name (empty string if undefined).
-
getApplicationVersion
Gets the application's version.- Returns:
- The application's version (empty string if undefined).
-
getApplicationReleaseName
Gets the application's release name.- Returns:
- The application's release name (empty string if undefined).
-
getApplicationBuildDate
Gets the application's build date.- Returns:
- The application's build date.
-