Package madkit.kernel
Class MadkitProperties
- All Implemented Interfaces:
Serializable,Cloneable,Map<Object,Object>
The properties object used within MaDKit.
- Since:
- MadKit 5.0.2
- Version:
- 0.91
- Author:
- Fabien Michel
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final booleanShortcut for System.getProperty("javawebstart.version") !Fields inherited from class java.util.Properties
defaults -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic InputStreamgetInputStream(String pathname) Return anInputStreamon a file. pathname could be relative to (1) the actual MaDKit class path, which is preferable considering jar export, or (2) the user.dir, or it could be an absolute path.voidloadPropertiesFromFile(String pathname) Loads properties from a properties file (classic or XML).voidloadPropertiesFromMaDKitXML(String filePath) Loads properties from an XML file.voidloadPropertiesFromPropertiesFile(String pathname) Loads properties from a regular properties formatted file.toString()Methods inherited from class java.util.Properties
clear, clone, compute, computeIfAbsent, computeIfPresent, contains, containsKey, containsValue, elements, entrySet, equals, forEach, get, getOrDefault, getProperty, getProperty, hashCode, isEmpty, keys, keySet, list, list, load, load, loadFromXML, merge, propertyNames, put, putAll, putIfAbsent, rehash, remove, remove, replace, replace, replaceAll, save, setProperty, size, store, store, storeToXML, storeToXML, storeToXML, stringPropertyNames, values
-
Field Details
-
JAVAWS_IS_ON
public static final boolean JAVAWS_IS_ONShortcut for System.getProperty("javawebstart.version") != null;
-
-
Constructor Details
-
MadkitProperties
public MadkitProperties()
-
-
Method Details
-
loadPropertiesFromMaDKitXML
Loads properties from an XML file.- Parameters:
filePath- can be absolute or relative- Throws:
IOException
-
loadPropertiesFromPropertiesFile
Loads properties from a regular properties formatted file.- Parameters:
pathname-- Throws:
IOException
-
loadPropertiesFromFile
Loads properties from a properties file (classic or XML).- Parameters:
pathname-- Throws:
IOException
-
getInputStream
Return anInputStreamon a file. pathname could be relative to (1) the actual MaDKit class path, which is preferable considering jar export, or (2) the user.dir, or it could be an absolute path. The returned input stream should be closed once done.- Parameters:
pathname- A pathname string If thepathnameargument isnull- Returns:
- an
InputStreamby opening a connection to an actual file, ornullif the file is not found. - Throws:
NullPointerExceptionIOException
-
toString
- Overrides:
toStringin classProperties
-