|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jnetpcap.util.config.JConfig
public class JConfig
JConfig is responsible for jNetPcap configuration and global environment maintentance. Its main purpose to locate resources such as config files, read system properties and create an environment where resolver files can be stored and maintained. The class provides various static (global) methods for this purpose.
Property names and constant values:
| Nested Class Summary | |
|---|---|
protected static class |
JConfig.ClasspathSearch
The Class ClasspathSearch. |
protected static class |
JConfig.FilesystemSearch
The Class FilesystemSearch. |
static interface |
JConfig.SearchPath
Interface used to piece together specific types of search paths. |
protected static class |
JConfig.URLSearch
The Class URLSearch. |
| Field Summary | |
|---|---|
static java.lang.String |
CACHE_DIR_PROPERTY
Java property for resolver directory where resolver files are saved. |
static java.lang.String |
CACHE_FILE_SUFFIX
Suffix of a resolver file. |
static java.lang.String |
CACHE_FILE_SUFFIX_PROPERTY
Suffix of a resolver file. |
static java.lang.String |
CACHE_SUB_DIR
If resolver directory is not explicitely defined with a property, this is the default sub directory name used in user's home directory for all resolver files. |
static java.lang.String |
CACHE_SUB_DIR_PROPERTY
If resolver directory is not explicitely defined with a. |
static java.lang.String |
RESOURCE_SEARCH_PATH_PROPERTY
The Constant RESOURCE_SEARCH_PATH_PROPERTY. |
static java.lang.String |
USER_HOME_PROPERTY
System property name used to lookup user's home directory. |
| Constructor Summary | |
|---|---|
JConfig()
|
|
| Method Summary | |
|---|---|
static void |
addListener(java.beans.PropertyChangeListener listener,
java.lang.String defaults)
Adds listener on any property change event. |
static void |
addListener(java.beans.PropertyChangeListener listener,
java.lang.String property,
boolean defaults)
Adds the listener. |
static void |
addListener(java.beans.PropertyChangeListener listener,
java.lang.String property,
int defaults)
Adds the listener. |
static void |
addListener(java.beans.PropertyChangeListener listener,
java.lang.String property,
long defaults)
Adds the listener. |
static void |
addListener(java.beans.PropertyChangeListener listener,
java.lang.String property,
java.lang.String defaults)
Adds the listener. |
static ConfigString |
createConfigString(java.lang.String str)
Creates the config string. |
static java.io.File |
createDir(java.lang.String property,
java.lang.String defaults)
Creates the dir. |
static JConfig.SearchPath[] |
createSearchPath(java.lang.String property)
Creates the search path. |
static SearchpathString |
createSearchString(java.lang.String str)
Creates the search string. |
static java.io.File |
getDir(JConfig.SearchPath[] paths)
Gets the dir. |
static java.io.File |
getDir(java.lang.String property)
Gets the dir. |
static java.lang.String |
getExpandedProperty(java.lang.String property)
Gets the expanded property. |
static java.lang.String |
getExpandedProperty(java.lang.String property,
java.lang.String defaults)
Gets the expanded property. |
static java.io.File |
getFile(java.lang.String name,
JConfig.SearchPath[] paths)
Gets the file. |
static java.io.File |
getFile(java.lang.String name,
java.lang.String property)
Gets the file. |
static java.util.Map<java.lang.String,java.lang.String> |
getGlobalVariables()
Gets the global variables. |
static java.io.InputStream |
getInputStream(java.lang.String name,
JConfig.SearchPath[] paths)
Gets the input stream. |
static java.io.InputStream |
getInputStream(java.lang.String name,
java.lang.String property)
Gets the input stream. |
static java.lang.String |
getProperty(java.lang.String property)
Gets the property. |
static java.lang.String |
getProperty(java.lang.String property,
java.lang.String defaults)
Gets the property. |
static java.io.InputStream |
getResourceInputStream(java.lang.String name)
Gets the resource input stream. |
static java.net.URL |
getResourceURL(java.lang.String name)
Gets the resource url. |
static java.util.Properties |
getTopProperties()
Gets the top properties. |
static java.net.URL |
getURL(java.lang.String name,
java.lang.String property)
Gets the uRL. |
static java.util.Properties |
getUserProperties()
Gets the user properties. |
static void |
init()
Inits the. |
static void |
removeListener(java.beans.PropertyChangeListener listener)
Removes the listener. |
static void |
removeListener(java.beans.PropertyChangeListener listener,
java.lang.String property)
Removes the listener. |
static java.lang.String |
setProperty(java.lang.String property,
java.lang.String value)
Sets the property. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String CACHE_DIR_PROPERTY
public static final java.lang.String CACHE_FILE_SUFFIX
public static final java.lang.String CACHE_FILE_SUFFIX_PROPERTY
public static final java.lang.String CACHE_SUB_DIR
public static final java.lang.String CACHE_SUB_DIR_PROPERTY
public static final java.lang.String RESOURCE_SEARCH_PATH_PROPERTY
public static final java.lang.String USER_HOME_PROPERTY
| Constructor Detail |
|---|
public JConfig()
| Method Detail |
|---|
public static void addListener(java.beans.PropertyChangeListener listener,
java.lang.String defaults)
listener - the listenerdefaults - the defaults
public static void addListener(java.beans.PropertyChangeListener listener,
java.lang.String property,
boolean defaults)
listener - the listenerproperty - the propertydefaults - the defaults
public static void addListener(java.beans.PropertyChangeListener listener,
java.lang.String property,
int defaults)
listener - the listenerproperty - the propertydefaults - the defaults
public static void addListener(java.beans.PropertyChangeListener listener,
java.lang.String property,
long defaults)
listener - the listenerproperty - the propertydefaults - the defaults
public static void addListener(java.beans.PropertyChangeListener listener,
java.lang.String property,
java.lang.String defaults)
listener - the listenerproperty - the propertydefaults - the defaultspublic static JConfig.SearchPath[] createSearchPath(java.lang.String property)
property - the property
public static java.io.File getFile(java.lang.String name,
JConfig.SearchPath[] paths)
throws java.io.IOException
name - the namepaths - the paths
java.io.IOException - Signals that an I/O exception has occurred.
public static java.io.File getFile(java.lang.String name,
java.lang.String property)
throws java.io.IOException
name - the nameproperty - the property
java.io.IOException - Signals that an I/O exception has occurred.
public static java.io.InputStream getInputStream(java.lang.String name,
JConfig.SearchPath[] paths)
throws java.io.IOException
name - the namepaths - the paths
java.io.IOException - Signals that an I/O exception has occurred.
public static java.io.InputStream getInputStream(java.lang.String name,
java.lang.String property)
throws java.io.IOException
name - the nameproperty - the property
java.io.IOException - Signals that an I/O exception has occurred.public static java.lang.String getProperty(java.lang.String property)
property - the property
public static java.lang.String getExpandedProperty(java.lang.String property)
property - the property
public static java.lang.String getExpandedProperty(java.lang.String property,
java.lang.String defaults)
property - the propertydefaults - the defaults
public static java.lang.String getProperty(java.lang.String property,
java.lang.String defaults)
property - the propertydefaults - the defaults
public static java.io.InputStream getResourceInputStream(java.lang.String name)
throws java.io.IOException
name - the name
java.io.IOException - Signals that an I/O exception has occurred.
public static java.net.URL getResourceURL(java.lang.String name)
throws java.io.IOException
name - the name
java.io.IOException - Signals that an I/O exception has occurred.
public static java.net.URL getURL(java.lang.String name,
java.lang.String property)
throws java.io.IOException
name - the nameproperty - the property
java.io.IOException - Signals that an I/O exception has occurred.public static void init()
public static void removeListener(java.beans.PropertyChangeListener listener)
listener - the listener
public static void removeListener(java.beans.PropertyChangeListener listener,
java.lang.String property)
listener - the listenerproperty - the property
public static java.lang.String setProperty(java.lang.String property,
java.lang.String value)
property - the propertyvalue - the value
public static java.io.File getDir(JConfig.SearchPath[] paths)
paths - the paths
public static java.io.File getDir(java.lang.String property)
property - the property
public static java.io.File createDir(java.lang.String property,
java.lang.String defaults)
property - the propertydefaults - the defaults
public static ConfigString createConfigString(java.lang.String str)
str - the str
public static SearchpathString createSearchString(java.lang.String str)
str - the str
public static java.util.Properties getTopProperties()
public static java.util.Properties getUserProperties()
public static java.util.Map<java.lang.String,java.lang.String> getGlobalVariables()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||