public class AppConfiguration extends Object implements Configuration
DEFAULT_RESOURCES_LOCATION, DIR, RESOURCES_LOCATION
Constructor and Description |
---|
AppConfiguration()
Create a new, uninitialized application configuration.
|
AppConfiguration(String applicationId)
Create the application configuration.
|
AppConfiguration(String applicationId,
AppVersion version)
Create the application configuration.
|
AppConfiguration(String applicationId,
String longName)
Create the application configuration.
|
AppConfiguration(String applicationId,
String longName,
AppVersion version)
Create the application configuration.
|
Modifier and Type | Method and Description |
---|---|
void |
destroy()
Clean up configuration resources.
|
String |
getApplicationId()
Get the name of the application (e.g.
|
String[] |
getCommandLineArgs()
Get the command line arguments of the application.
|
File |
getDataDir()
Get the data directory as File
|
String |
getFullName()
Get the full name of the application, which consists of the long name and the version number (e.g.
|
LogConfiguration |
getLogConfiguration()
Get logging configuration
|
String |
getLongName()
Get the long name of the application (e.g.
|
Properties |
getProperties()
Get the properties
|
ProxySettings |
getProxySettings()
Get proxy settings
|
AppVersion |
getVersion()
Get the version of the application.
|
void |
init()
Initialize the configuration settings.
|
void |
init(boolean loadLogConfig)
Initialize configuration and proxy settings, optionally load (logback) logging
|
void |
load()
Load the configuration settings.
|
void |
save()
Store configuration settings.
|
void |
setApplicationId(String applicationId)
Set the application ID string
|
void |
setCommandLineArgs(String[] args)
Set the command line arguments specified to the application.
|
void |
setDataDirName(String dataDirName)
Set the name of the data directory
|
void |
setLongName(String longName)
Set the long name of the application.
|
void |
setProxySettings(ProxySettings proxySettings)
Set proxy settings
|
void |
setVersion(AppVersion version)
Set the version of the application.
|
public AppConfiguration()
public AppConfiguration(String applicationId)
applicationId
- the ID of the applicationpublic AppConfiguration(String applicationId, AppVersion version)
applicationId
- the ID of the applicationversion
- the application's versionpublic AppConfiguration(String applicationId, String longName)
applicationId
- the ID of the applicationlongName
- the long name of the applicationpublic AppConfiguration(String applicationId, String longName, AppVersion version)
applicationId
- the ID of the applicationlongName
- the long name of the applicationversion
- the application's versionpublic void load() throws IOException
Configuration
load
in interface Configuration
IOException
- if the configuration settings could not be loaded due to an I/O problem.public void save() throws IOException
Configuration
save
in interface Configuration
IOException
- if the configuration settings could not be saved due to an I/O problem.public void init() throws IOException
Configuration
init
in interface Configuration
IOException
- if the configuration settings could not be initialized because of an I/O problem.public void init(boolean loadLogConfig) throws IOException
loadLogConfig
- load logging configurationIOException
public void destroy() throws IOException
Configuration
destroy
in interface Configuration
IOException
- if one or more resources could not be cleaned up. Implementations should attempt to clean up
as many resources as possible before returning or throwing an exception.public String getApplicationId()
public final void setApplicationId(String applicationId)
applicationId
- stringpublic void setDataDirName(String dataDirName)
dataDirName
- public String getLongName()
public final void setLongName(String longName)
longName
- the new namepublic String getFullName()
public AppVersion getVersion()
public final void setVersion(AppVersion version)
version
- the new versionpublic String[] getCommandLineArgs()
public void setCommandLineArgs(String[] args)
args
- A String array containing the arguments as specified to the main method.public File getDataDir()
public LogConfiguration getLogConfiguration()
public ProxySettings getProxySettings()
public void setProxySettings(ProxySettings proxySettings)
proxySettings
- proxy settingspublic Properties getProperties()
Copyright © 2015-2022 Eclipse Foundation. All Rights Reserved.