Class Configuration


  • public class Configuration
    extends java.lang.Object
    Provides access to configuration values.
    Since:
    2.4
    Author:
    Jason Dillon, Guillaume Nodet
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String JLINE_CONFIGURATION
      System property which can point to a file or URL containing configuration properties to load.
      static java.lang.String JLINE_RC
      Default configuration file name loaded from user's home directory.
    • Constructor Summary

      Constructors 
      Constructor Description
      Configuration()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean getBoolean​(java.lang.String name)  
      static boolean getBoolean​(java.lang.String name, boolean defaultValue)  
      static java.lang.String getEncoding()
      Get the default encoding.
      static java.lang.String getFileEncoding()  
      static int getInteger​(java.lang.String name, int defaultValue)  
      static java.lang.String getLineSeparator()  
      static long getLong​(java.lang.String name, long defaultValue)  
      static java.lang.String getOsName()  
      static java.util.Properties getProperties()  
      static java.lang.String getString​(java.lang.String name)  
      static java.lang.String getString​(java.lang.String name, java.lang.String defaultValue)  
      static java.io.File getUserHome()  
      static boolean isHpux()  
      static boolean isWindows()  
      static void reset()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • JLINE_CONFIGURATION

        public static final java.lang.String JLINE_CONFIGURATION
        System property which can point to a file or URL containing configuration properties to load.
        Since:
        2.7
        See Also:
        Constant Field Values
      • JLINE_RC

        public static final java.lang.String JLINE_RC
        Default configuration file name loaded from user's home directory.
        See Also:
        Constant Field Values
    • Constructor Detail

      • Configuration

        public Configuration()
    • Method Detail

      • reset

        public static void reset()
        Since:
        2.7
      • getProperties

        public static java.util.Properties getProperties()
        Since:
        2.7
      • getString

        public static java.lang.String getString​(java.lang.String name,
                                                 java.lang.String defaultValue)
      • getString

        public static java.lang.String getString​(java.lang.String name)
      • getBoolean

        public static boolean getBoolean​(java.lang.String name)
      • getBoolean

        public static boolean getBoolean​(java.lang.String name,
                                         boolean defaultValue)
      • getInteger

        public static int getInteger​(java.lang.String name,
                                     int defaultValue)
        Since:
        2.6
      • getLong

        public static long getLong​(java.lang.String name,
                                   long defaultValue)
        Since:
        2.6
      • getLineSeparator

        public static java.lang.String getLineSeparator()
        Since:
        2.7
      • getUserHome

        public static java.io.File getUserHome()
      • getOsName

        public static java.lang.String getOsName()
      • isWindows

        public static boolean isWindows()
        Since:
        2.7
      • isHpux

        public static boolean isHpux()
      • getFileEncoding

        public static java.lang.String getFileEncoding()
      • getEncoding

        public static java.lang.String getEncoding()
        Get the default encoding. Will first look at the LC_ALL, LC_CTYPE, and LANG environment variables, then the input.encoding system property, then the default charset according to the JVM.
        Returns:
        The default encoding to use when none is specified.