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() |
String |
getFullName()
Get the full name of the application, which consists of the long name and
the version number (e.g.
|
LogConfiguration |
getLogConfiguration() |
String |
getLongName()
Get the long name of the application (e.g.
|
Properties |
getProperties() |
ProxySettings |
getProxySettings() |
AppVersion |
getVersion()
Get the version of the application.
|
void |
init()
Initialize the configuration settings.
|
void |
init(boolean loadLogConfig) |
void |
load()
Load the configuration settings.
|
void |
save()
Store configuration settings.
|
void |
setApplicationId(String applicationId) |
void |
setCommandLineArgs(String[] args)
Set the command line arguments specified to the application.
|
void |
setDataDirName(String dataDirName) |
void |
setLongName(String longName)
Set the long name of the application.
|
void |
setProxySettings(ProxySettings proxySettings) |
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
IOException
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)
public void setDataDirName(String 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)
public Properties getProperties()
Copyright © 2001–2017 Aduna. All rights reserved.