Class Config
java.lang.Object
clazzfish.core.Config
All config stuff is encapsulated in this class.
- Since:
- 2.3 (05.12.24)
- Author:
- oboehm
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic Configstatic final StringProperty name of the directory where the class statistic is dumped to.static final StringProperty name of URI where the class statistic is dumped to.static final URINULL URI.static final StringPattern of the resources (and classes) which should be filtered out. -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic ClassLoaderGets the class loader.Get the directory where the collected dates and statistics are dumped to.Get the directory or URI where the collected dates and statistics are dumped to.static StringgetEnvironment(String key) Gets the system property for the given key.getProperty(String name) inthashCode()static PropertiesloadProperties(InputStream istream) Loads the properties from the given InputStream and provides them as system properties.static PropertiesloadProperties(String resource) Loads the properties from the classpath and provides them as system properties.static Configstatic Configof(Properties props) voidsetDumpDir(File dir) Here you can set the directory where the collected dates and statistics should be dumped to.voidsetDumpURI(URI uri) Here you can set the directory or locaction where the collected dates and statistics should be dumped to.toString()
-
Field Details
-
DUMP_DIR
Property name of the directory where the class statistic is dumped to.- See Also:
-
DUMP_URI
Property name of URI where the class statistic is dumped to.- See Also:
-
PATTERN_EXCLUDE
Pattern of the resources (and classes) which should be filtered out.- See Also:
-
NULL_URI
NULL URI. -
DEFAULT
-
-
Method Details
-
of
-
of
-
getEnvironment
Gets the system property for the given key. If it is not set as system property it tries to find it as environment variable (in uppercase and with underscores instead of dots).- Parameters:
key- name of the property or environment variable (in lowercase)- Returns:
- found value or null
-
loadProperties
Loads the properties from the classpath and provides them as system properties.- Parameters:
resource- the name of the classpath resource- Returns:
- the loaded properties
- Throws:
IOException- if properties can't be loaded- See Also:
-
getClassLoader
-
loadProperties
Loads the properties from the given InputStream and provides them as system properties.Note: Setting it as system property is not guaranteed to run in a cluster or cloud. E.g. on Google's App Engine this seems not to work.
- Parameters:
istream- from here the properties are loaded- Returns:
- the loaded properties
- Throws:
IOException- if properties can't be loaded
-
getDumpDir
Get the directory where the collected dates and statistics are dumped to.- Returns:
- directory for export
-
setDumpDir
Here you can set the directory where the collected dates and statistics should be dumped to.- Parameters:
dir- directory for export
-
getDumpURI
Get the directory or URI where the collected dates and statistics are dumped to.- Returns:
- directory or URI for export
-
setDumpURI
Here you can set the directory or locaction where the collected dates and statistics should be dumped to.- Parameters:
uri- directory or URI for export
-
getProperties
-
getProperty
-
toString
-
equals
-
hashCode
-