madkit.util

## Class MadkitProperties

- java.lang.Object
- - java.util.Dictionary<K,V>
  - - java.util.Hashtable<java.lang.Object,java.lang.Object>
    - - java.util.Properties
      - - madkit.util.MadkitProperties

- All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, java.util.Map<java.lang.Object,java.lang.Object>

      public class MadkitProperties
      extends java.util.Properties

  The properties object used within MaDKit.
  Since:
    MadKit 5.0.2
  Version:
    0.91
  Author:
    Fabien Michel
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static boolean` | `JAVAWS_IS_ON` Shortcut for System.getProperty("javawebstart.version") !

    - ### Fields inherited from class java.util.Properties

      `defaults`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MadkitProperties()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static java.io.InputStream` | `getInputStream(java.lang.String pathname)` Return an `InputStream` on a file.
    `void` | `loadPropertiesFromFile(java.lang.String pathname)` Loads properties from a properties file (classic or XML).
    `void` | `loadPropertiesFromMaDKitXML(java.lang.String filePath)` Loads properties from an XML file.
    `void` | `loadPropertiesFromPropertiesFile(java.lang.String pathname)` Loads properties from a regular properties formatted file.

    - ### Methods inherited from class java.util.Properties

      `getProperty, getProperty, list, list, load, load, loadFromXML, propertyNames, save, setProperty, store, store, storeToXML, storeToXML, stringPropertyNames`

    - ### Methods inherited from class java.util.Hashtable

      `clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, put, putAll, rehash, remove, size, toString, values`

    - ### Methods inherited from class java.lang.Object

      `finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### JAVAWS_IS_ON

          public static final boolean JAVAWS_IS_ON

      Shortcut for System.getProperty("javawebstart.version") != null;

  - ### Constructor Detail

    - #### MadkitProperties

          public MadkitProperties()

  - ### Method Detail

    - #### loadPropertiesFromMaDKitXML

          public void loadPropertiesFromMaDKitXML(java.lang.String filePath)
                                           throws java.io.IOException

      Loads properties from an XML file.
      Parameters:
        `filePath` - can be absolute or relative
      Throws:
        `java.io.IOException`

    - #### loadPropertiesFromPropertiesFile

          public void loadPropertiesFromPropertiesFile(java.lang.String pathname)
                                                throws java.io.IOException

      Loads properties from a regular properties formatted file.
      Parameters:
        `pathname` -
      Throws:
        `java.io.IOException`

    - #### loadPropertiesFromFile

          public void loadPropertiesFromFile(java.lang.String pathname)
                                      throws java.io.IOException

      Loads properties from a properties file (classic or XML).
      Parameters:
        `pathname` -
      Throws:
        `java.io.IOException`

    - #### getInputStream

          public static java.io.InputStream getInputStream(java.lang.String pathname)
                                                    throws java.io.IOException

      Return an `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.
      Parameters:
        `pathname` - A pathname string If the `pathname` argument is `null`
      Returns:
        an `InputStream` by opening a connection to an actual file, or `null` if the file is not found.
      Throws:
        `java.lang.NullPointerException`
        `java.io.IOException`

Fabien Michel, Olivier Gutknecht, Jacques Ferber - November 18 2014