Class Configuration

java.lang.Object
jline.internal.Configuration

public class Configuration extends Object
Provides access to configuration values.
Since:
2.4
  • Field Details

    • JLINE_CONFIGURATION

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

      public static final String JLINE_RC
      Default configuration file name loaded from user's home directory.
      See Also:
    • properties

      private static volatile Properties properties
  • Constructor Details

    • Configuration

      public Configuration()
  • Method Details

    • initProperties

      private static Properties initProperties()
    • loadProperties

      private static void loadProperties(URL url, Properties props) throws IOException
      Throws:
      IOException
    • determineUrl

      private static URL determineUrl()
    • reset

      public static void reset()
      Since:
      2.7
    • getProperties

      public static Properties getProperties()
      Since:
      2.7
    • getString

      public static String getString(String name, String defaultValue)
    • getString

      public static String getString(String name)
    • getBoolean

      public static boolean getBoolean(String name)
    • getBoolean

      public static boolean getBoolean(String name, boolean defaultValue)
    • getInteger

      public static int getInteger(String name, int defaultValue)
      Since:
      2.6
    • getLong

      public static long getLong(String name, long defaultValue)
      Since:
      2.6
    • getLineSeparator

      public static String getLineSeparator()
      Since:
      2.7
    • getUserHome

      public static File getUserHome()
    • getOsName

      public static String getOsName()
    • isWindows

      public static boolean isWindows()
      Since:
      2.7
    • isHpux

      public static boolean isHpux()
    • getFileEncoding

      public static String getFileEncoding()
    • getEncoding

      public static 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.
    • extractEncodingFromCtype

      static String extractEncodingFromCtype(String ctype)
      Parses the LC_CTYPE value to extract the encoding according to the POSIX standard, which says that the LC_CTYPE environment variable may be of the format [language[_territory][.codeset][@modifier]]
      Parameters:
      ctype - The ctype to parse, may be null
      Returns:
      The encoding, if one was present, otherwise null