public class MadkitProperties extends Properties
Modifier and Type | Field and Description |
---|---|
static boolean |
JAVAWS_IS_ON
Shortcut for System.getProperty("javawebstart.version") !
|
defaults
Constructor and Description |
---|
MadkitProperties() |
Modifier and Type | Method and Description |
---|---|
static InputStream |
getInputStream(String pathname)
Return an
InputStream on a file. |
void |
loadPropertiesFromFile(String pathname)
Loads properties from a properties file (classic or XML).
|
void |
loadPropertiesFromMaDKitXML(String filePath)
Loads properties from an XML file.
|
void |
loadPropertiesFromPropertiesFile(String pathname)
Loads properties from a regular properties formatted file.
|
getProperty, getProperty, list, list, load, load, loadFromXML, propertyNames, save, setProperty, store, store, storeToXML, storeToXML, stringPropertyNames
clear, clone, compute, computeIfAbsent, computeIfPresent, contains, containsKey, containsValue, elements, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keys, keySet, merge, put, putAll, putIfAbsent, rehash, remove, remove, replace, replace, replaceAll, size, toString, values
public static final boolean JAVAWS_IS_ON
public void loadPropertiesFromMaDKitXML(String filePath) throws IOException
filePath
- can be absolute or relativeIOException
public void loadPropertiesFromPropertiesFile(String pathname) throws IOException
pathname
- IOException
public void loadPropertiesFromFile(String pathname) throws IOException
pathname
- IOException
public static InputStream getInputStream(String pathname) throws IOException
InputStream
on 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.pathname
- A pathname string
If the pathname
argument is null
InputStream
by
opening a connection to an actual file, or null
if the file is not found.NullPointerException
IOException
Fabien Michel, Olivier Gutknecht, Jacques Ferber - September 27 2016