Enum About

java.lang.Object
java.lang.Enum<About>
org.apache.sis.setup.About
All Implemented Interfaces:
Serializable, Comparable<About>, java.lang.constant.Constable

public enum About extends Enum<About>
Provides information about the Apache SIS running environment. This class collects information from various places like Version.SIS, System.getProperties(), Locale.getDefault() or TimeZone.getDefault(). This class does not collect every possible information. Instead, it tries to focus on the most important information for SIS, as determined by experience in troubleshooting. Some of those information are:
  • Version numbers (SIS, Java, Operation system).
  • Default locale, timezone and character encoding.
  • Current directory, user home and Java home.
  • Libraries on the classpath and extension directories.
Since:
0.3
Version:
0.8
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    private static final class 
    Filters the JAR files in an extension directory.

    Nested classes/interfaces inherited from class java.lang.Enum

    Enum.EnumDesc<E extends Enum<E>>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    Information about the libraries.
    Information about default locale, timezone and character encoding.
    Information about logging.
    Information about user home directory, java installation directory or other kind of data.
    Information about available plugins.
    Information about software version numbers.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final short
    The resource key for this section in the Vocabulary resources bundle.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
    About(short resourceKey)
    Creates a new section to be formatted using the given resource.
  • Method Summary

    Modifier and Type
    Method
    Description
    private static Map<File,CharSequence>
    classpath(String paths, boolean asDirectories)
    Returns a map of all JAR files or class directories found in the given paths, associated to a description obtained from their META-INF/MANIFEST.MF.
    private static boolean
    classpath(String paths, File directory, boolean asDirectories, Map<File,CharSequence> files)
    Implementation of classpath(String, boolean) to be invoked recursively.
    private static CharSequence
    concatenate(CharSequence main, CharSequence complement, boolean parenthesis)
    Concatenates the given strings in the format "main (complement)".
    private static TreeTable.Node
    For every branch containing only one child and no value, merges in-place that branch and the node together.
    static TreeTable
    Returns all known information about the current Apache SIS running environment.
    static TreeTable
    configuration(Set<About> sections, Locale locale, TimeZone timezone)
    Returns a subset of the information about the current Apache SIS running environment.
    private static StringBuffer
    format(Format df, int offset, StringBuffer buffer)
    Formats the given value preceded by a plus or minus sign.
    private static String
    getCode(Locale locale, boolean country)
    Returns the ISO language or country code for the given locale.
    private static void
    If a file path in the given node or any children follow the Maven pattern, remove the artifact name and version numbers redundancies in order to make the name more compact.
    private static CharSequence
    Returns the given text between parenthesis.
    private static File
    relativize(File root, File file)
    Returns the given file relative to the given root, or null if the root is not a parent of that file.
    static About
    Returns the enum constant of this type with the specified name.
    static About[]
    Returns an array containing the constants of this enum type, in the order they are declared.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • VERSIONS

      public static final About VERSIONS
      Information about software version numbers. This section includes:
      • Apache SIS version
      • Java runtime version and vendor
      • Operation system name and version
      • EPSG geodetic dataset in use
    • LOCALIZATION

      public static final About LOCALIZATION
      Information about default locale, timezone and character encoding. This section includes:
      • Default locale, completed by ISO 3-letter codes
      • Default timezone, completed by timezone offset
      • Current date and time in the default timezone
      • Default character encoding
    • PLUGINS

      public static final About PLUGINS
      Information about available plugins. This section includes:
      • List of data store implementations
      Since:
      0.8
    • LOGGING

      public static final About LOGGING
      Information about logging.
    • PATHS

      public static final About PATHS
      Information about user home directory, java installation directory or other kind of data. This section includes:
      • User directory
      • Default directory
      • SIS data directory
      • Temporary directory
      • Java home directory
    • LIBRARIES

      public static final About LIBRARIES
      Information about the libraries. This section includes:
      • JAR files in the extension directories
      • JAR files and directories in the application classpath
  • Field Details

    • resourceKey

      private final short resourceKey
      The resource key for this section in the Vocabulary resources bundle.
  • Constructor Details

    • About

      private About(short resourceKey)
      Creates a new section to be formatted using the given resource.
  • Method Details

    • values

      public static About[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static About valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • configuration

      public static TreeTable configuration()
      Returns all known information about the current Apache SIS running environment. The information are formatted using the system default locale and timezone.

      This convenience method is equivalent to the following code:

      Returns:
      configuration information, as a tree for grouping some configuration by sections.
    • configuration

      public static TreeTable configuration(Set<About> sections, Locale locale, TimeZone timezone)
      Returns a subset of the information about the current Apache SIS running environment.
      Parameters:
      sections - the section for which information are desired.
      locale - the locale to use for formatting the texts in the tree, or null for the default.
      timezone - the timezone to use for formatting the dates, or null for the default.
      Returns:
      configuration information, as a tree for grouping some configuration by sections.
    • classpath

      private static Map<File,CharSequence> classpath(String paths, boolean asDirectories)
      Returns a map of all JAR files or class directories found in the given paths, associated to a description obtained from their META-INF/MANIFEST.MF.
      Parameters:
      paths - the paths using the File.pathSeparatorChar separator.
      asDirectories - true if the paths are directories, or false for JAR files.
      Returns:
      the paths, or null if none.
    • classpath

      private static boolean classpath(String paths, File directory, boolean asDirectories, Map<File,CharSequence> files)
      Implementation of classpath(String, boolean) to be invoked recursively. The paths argument may contains many path separated by one of the following separators:
      • If directory is null, then paths is assumed to be a system property value using the File.pathSeparatorChar.
      • If directory is non-null, then paths is assumed to be a MANIFEST.MF attribute using space as the path separator.
      Parameters:
      paths - the paths using the separator described above.
      directory - the directory of MANIFEST.MF classpath, or null.
      asDirectories - true if the paths are directories, or false for JAR files.
      files - where to add the paths.
      Returns:
      true if the given map has been changed as a result of this method call.
    • omitMavenRedundancy

      private static void omitMavenRedundancy(TreeTable.Node node)
      If a file path in the given node or any children follow the Maven pattern, remove the artifact name and version numbers redundancies in order to make the name more compact. For example, this method replaces "org/opengis/geoapi/3.0.0/geoapi-3.0.0.jar" by "org/opengis/(…)/geoapi-3.0.0.jar".
    • concatenateSingletons

      private static TreeTable.Node concatenateSingletons(TreeTable.Node node, boolean skip)
      For every branch containing only one child and no value, merges in-place that branch and the node together. This method is used for simplifying depth trees into something less verbose. However for any column other than NAME, this method preserves the values of the child node but lost all value of the parent node. For this reason, we perform the merge only if the parent has no value.

      See the "Reduce the depth of a tree" example in TreeTables for more information. In particular, note that this implementation assumes that children collections are List (this is guaranteed for DefaultTreeTable.Node implementations).

      Parameters:
      node - the root of the node to simplify.
      skip - true for disabling concatenation of root node.
      Returns:
      the root of the simplified tree. May be the given node or a child.
    • concatenate

      private static CharSequence concatenate(CharSequence main, CharSequence complement, boolean parenthesis)
      Concatenates the given strings in the format "main (complement)". Any of the given strings can be null.
      Parameters:
      main - the main string to show first, or null.
      complement - the string to show after the main one, or null.
      parenthesis - true for writing the complement between parenthesis, or null.
      Returns:
      the concatenated string, or null if all components are null.
    • parenthesis

      private static CharSequence parenthesis(String text)
      Returns the given text between parenthesis.
    • getCode

      private static String getCode(Locale locale, boolean country)
      Returns the ISO language or country code for the given locale. Whether we use 2-letters or 3-letters code shall be consistent with ValueConverter.
    • format

      private static StringBuffer format(Format df, int offset, StringBuffer buffer)
      Formats the given value preceded by a plus or minus sign. This method is used for formatting timezone offset.
      Parameters:
      df - the DateFormat to use for formatting the offset.
      offset - the offset to format, as a positive or negative value.
      buffer - the buffer where to format the offset.
      Returns:
      the given buffer, returned for convenience.
    • relativize

      private static File relativize(File root, File file)
      Returns the given file relative to the given root, or null if the root is not a parent of that file.
      Parameters:
      root - the root directory (typically Java home or user home directory).
      file - the file to make relative to the root.
      Returns:
      the file relative to the given root, or null if none.