|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--jade.util.BasicProperties | +--jade.util.ImportableProperties | +--jade.util.EnhancedProperties | +--jade.util.ExpandedProperties
Extends EnhancedProperties and adds support for fetching system environment variables (those usable from the OS shell). This class would need to be carefully considered in different environments. This class relates to four others as follows:
return new InputStreamReader(new FileInputStream(aFileName));whereas in the CLDC environment it would be:
return new InputStreamReader(Connector.openInputStream(aFileName));
Constructor Summary | |
ExpandedProperties()
Construct empty property collection. |
|
ExpandedProperties(java.lang.String aFileName)
Construct properties from specified file. |
|
ExpandedProperties(java.lang.String[] theArgs)
Construct properties from arguments. |
Method Summary | |
protected static java.lang.String |
getCommandOutput(java.lang.String aCommand,
boolean isShellCommand)
Execute a command and return its output as a string. |
static BasicProperties |
getEnvironmentProperties()
Fetch the system's environment properties and return them in an EnhancedProperties object. |
protected java.lang.String |
getEnvironmentProperty(java.lang.String key)
Fetch environment property by looking calling System.getProperty. |
protected BasicProperties |
getEnvProperties()
Used to fetch environment properties and initialize environment properties object if this is first invocation. |
java.lang.String |
locatePropertyFile(java.lang.String aPropertyFileName,
java.lang.String aSearchCeiling)
Locate property file. |
static void |
main(java.lang.String[] args)
For testing. |
protected java.lang.String |
scanDirectory(java.lang.String aPropertyFileName,
java.lang.String aPath,
int depth)
Scan a directory for a property file and examine just first level of subdirectories. |
protected java.lang.String |
testPropertyFile(java.lang.String aPropertyFileName)
Once the property file search has expanded beyond the current directory this method is used to examine property files which match the desired name - if it contains an import directive then return the value of that directive otherwise return the name of the property file. |
Methods inherited from class jade.util.EnhancedProperties |
fileReader |
Methods inherited from class jade.util.ImportableProperties |
addFromFile,
getImportKey,
setImportKey,
storableProperty |
Methods inherited from class jade.util.BasicProperties |
addFromReader,
copyProperties,
doSubstitutions,
doSubstitutions,
extractSubset,
get,
getBooleanProperty,
getIntProperty,
getOneLine,
getProperty,
getProperty,
getPropertyIgnoreCase,
getRawProperty,
isCandidate,
isolateKey,
isolateValue,
keys,
list,
load,
nextArgIndex,
parseArgs,
parseArgument,
prepareArgs,
put,
readLine,
renameKey,
setBooleanProperty,
setIntProperty,
setProperty,
setPropertyIfNot,
sortedKeys,
specialHandling,
store,
toStringArray,
valueFilter |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public ExpandedProperties()
public ExpandedProperties(java.lang.String[] theArgs)
theArgs
- The applications original arguments.public ExpandedProperties(java.lang.String aFileName) throws java.io.IOException
aFileName
- The name of the properties file.Method Detail |
public static void main(java.lang.String[] args)
protected java.lang.String getEnvironmentProperty(java.lang.String key)
key
- The key of the desired property.protected BasicProperties getEnvProperties()
public static BasicProperties getEnvironmentProperties()
public java.lang.String locatePropertyFile(java.lang.String aPropertyFileName, java.lang.String aSearchCeiling)
aPropertyFileName
- Name of desired property file.aSearchCeiling
- If none null then this specifies the uppermost
directory name where at which the search should ston.protected static java.lang.String getCommandOutput(java.lang.String aCommand, boolean isShellCommand)
aCommand
- The command to run.isShellCommand
- If true, then the command will be
prefixed with the appropriate system dependent shell invocation
(cmd.exe, command.com, or /bin/sh/).protected java.lang.String scanDirectory(java.lang.String aPropertyFileName, java.lang.String aPath, int depth)
aPropertyFileName
- Name of desired property file.aPath
- Current full path.depth
- Current depth - used to control recursive search depth of only
first level subdirectories.protected java.lang.String testPropertyFile(java.lang.String aPropertyFileName)
aPropertyFileName
- Name of property file.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |