public class Configuration
extends java.lang.Object
Currently, it contains variables of: ROOT_DIR, SYNONYM_FILE, CORPUS_FILE, LVG_CONFIG_FILE, etc.. Additional keys of variables can be used without defining in this class.
History:
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
AUTO_MODE
a mode to get the property file automatically for the classpath
|
static java.lang.String |
CORPUS_FILE
key for the path of corpus file defined in configuration file
|
static java.lang.String |
DB_DIR
Database directory
|
static java.lang.String |
DB_DRIVER
Data base
|
static java.lang.String |
DB_NAME
database name
|
static java.lang.String |
DB_URL
Java Data Base Connectivity URL
|
static java.lang.String |
LVG_CONFIG_FILE
key for the path of lvg config file defined in configuration file
|
static java.lang.String |
ROOT_DIR
key for the path of root directory of tool defined in config file
|
static java.lang.String |
SYNONYM_FILE
key for the path of synonym file defined in configuration file
|
static java.lang.String |
VERBOSE_FLAG
key for the verbose flag defined in configuration file
|
static java.lang.String |
VERBOSE_LINE_NUM
key for the verbose line num defined in configuration file
|
Constructor and Description |
---|
Configuration(java.lang.String fName,
boolean useClassPath)
Create a Configuration object.
|
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
GetAbsolutePath(java.lang.String inFileStr,
java.lang.String rootDirStr)
Return the absoluate path of the in file.
|
java.lang.String |
GetConfiguration(java.lang.String key)
Get a value from configuration file by specifying the key.
|
java.lang.String |
GetInformation()
Get system level information from configuration.
|
boolean |
IsEmptyConfig()
Check if the config table is empty.
|
void |
OverwriteProperties(java.util.Hashtable<java.lang.String,java.lang.String> properties)
Overwrite the value if it is specified in the properties.
|
public static final java.lang.String ROOT_DIR
public static final java.lang.String AUTO_MODE
public static final java.lang.String SYNONYM_FILE
public static final java.lang.String CORPUS_FILE
public static final java.lang.String LVG_CONFIG_FILE
public static final java.lang.String VERBOSE_FLAG
public static final java.lang.String VERBOSE_LINE_NUM
public static final java.lang.String DB_DRIVER
public static final java.lang.String DB_URL
public static final java.lang.String DB_DIR
public static final java.lang.String DB_NAME
public Configuration(java.lang.String fName, boolean useClassPath)
fName
- the path of the configuration file or base name when
using class path.useClassPath
- a flag of finding configurationfile from class pathpublic java.lang.String GetConfiguration(java.lang.String key)
key
- key (name) of the configuration value to be getpublic void OverwriteProperties(java.util.Hashtable<java.lang.String,java.lang.String> properties)
properties
- properties to be overwrite in the configurationpublic java.lang.String GetInformation()
public boolean IsEmptyConfig()
public static java.lang.String GetAbsolutePath(java.lang.String inFileStr, java.lang.String rootDirStr)
inFileStr
- input file string (relative or absolute path)rootDirStr
- the root directory of relative path Submit a bug or feature
Copyright © 2015 National Library of Medicine