| java.lang.Object org.obe.util.CommonConfig
All known Subclasses: org.obe.client.api.ClientConfig, org.obe.spi.service.ServerConfig,
CommonConfig | public class CommonConfig (Code) | | Provides common configuration-related functionality.
author: Adrian Price |
_logger | final protected static Log _logger(Code) | | |
CommonConfig | protected CommonConfig()(Code) | | |
findResource | public static URL findResource(String resource)(Code) | | Locates a configuration resource. The resource can either be in
the configuration directory, or it can be packaged in obeconfig.jar.
Parameters: resource - The resource name. The URL of the resource, or null if it could not belocated. |
getBooleanProperty | protected static boolean getBooleanProperty(String propertyName, boolean defaultValue)(Code) | | |
getConfigDir | public static File getConfigDir()(Code) | | Returns the configuration directory. Loose files in this directory
override their counterparts in the obeconfig.jar archive.
The setting reflects the string value of the system property
obe.config.dir .
The configuration directory, defaulting to the current directory. See Also: CommonConfig.CONFIG_DIR_PROP |
getCredentials | public static String getCredentials()(Code) | | Returns the credentials with which the client should authenticate.
The setting reflects the string value of the configuration property
obe.client.credentials .
Client credentials, defaulting to "password" . See Also: CommonConfig.CREDENTIALS_PROP |
getDefaultDateFormat | public static String getDefaultDateFormat()(Code) | | Returns the date format to be used when rendering dates.
The setting reflects the value of the configuration property
obe.xpdl.date.format .
Date format, defaulting to yyyy-MM-dd'T'HH:mm:ssZ . See Also: CommonConfig.DATE_FORMAT_PROP |
getDefaultDurationUnit | public static String getDefaultDurationUnit()(Code) | | Returns the default duration unit to use if an XPDL file does not specify
a default.
The setting reflects the value of the configuration property
obe.xpdl.duration.unit .
Default duration unit, defaulting to "D" (day). See Also: CommonConfig.DURATION_UNIT_PROP |
getIntProperty | protected static int getIntProperty(String propertyName, int defaultValue)(Code) | | |
getPrincipal | public static String getPrincipal()(Code) | | Returns the default client principal name.
The setting reflects the string value of the configuration property
obe.client.principal .
Client principal name, defaulting to "system" . See Also: CommonConfig.PRINCIPAL_PROP |
getProtocol | public static String getProtocol()(Code) | | Returns the default client protocol type.
The setting reflects the string value of the configuration property
obe.client.protocol .
Client protocol type, defaulting to "local" . See Also: CommonConfig.PROTOCOL_PROP |
openInputSource | public static InputSource openInputSource(String resource)(Code) | | Opens a SAX input source for a resource. The caller is responsible for
closing the associated byte stream afterwards.
Parameters: resource - The resource name. The input source, or null if the resource could notbe located. |
openInputStream | public static InputStream openInputStream(String resource)(Code) | | Opens an input stream for the specified resource. The caller is
responsible for closing the input stream after reading from it. The
implementation checks first whether the resource is present as a file in
the configuration directory, and if this is not the case it checks for
the presence of the resource inside the obeconfig.jar file.
Parameters: resource - The partially qualified resource name, relative tothe configuration directory or the root of obeconfig.jar. The input stream, or null if the resource could notbe located. |
openOutputStream | public static OutputStream openOutputStream(String resource)(Code) | | Opens an output stream for the specified resource. The caller is
responsible for closing the output stream after writing to it. The
implementation attempts to open the specified file in the configuration
directory (or a subdirectory thereof if the resource name contains a
path).
Parameters: resource - The partially qualified resource name, relative tothe configuration directory. The output stream, or null if the resource could notbe located. |
openReader | public static Reader openReader(String resource)(Code) | | Opens a character stream for a resource. The caller is responsible for
closing the reader afterwards.
Parameters: resource - The resource name. The character stream, or null if the resource couldnot be located. |
|
|