Class Environment


  • public class Environment
    extends Object
    The environment of where things exists.
    • Field Detail

      • PATH_HOME_SETTING

        public static final Setting<String> PATH_HOME_SETTING
      • PATH_LOGS_SETTING

        public static final Setting<String> PATH_LOGS_SETTING
      • PATH_SHARED_DATA_SETTING

        public static final Setting<String> PATH_SHARED_DATA_SETTING
      • PIDFILE_SETTING

        public static final Setting<String> PIDFILE_SETTING
      • NODE_PIDFILE_SETTING

        public static final Setting<String> NODE_PIDFILE_SETTING
    • Constructor Detail

      • Environment

        public Environment​(Settings settings,
                           Path configPath)
    • Method Detail

      • settings

        public Settings settings()
        The settings used to build this environment.
      • dataFiles

        public Path[] dataFiles()
        The data location.
      • sharedDataFile

        public Path sharedDataFile()
        The shared data location
      • repoFiles

        public Path[] repoFiles()
        The shared filesystem repo locations.
      • resolveRepoFile

        public Path resolveRepoFile​(String location)
        Resolves the specified location against the list of configured repository roots If the specified location doesn't match any of the roots, returns null.
      • resolveRepoURL

        public URL resolveRepoURL​(URL url)
        Checks if the specified URL is pointing to the local file system and if it does, resolves the specified url against the list of configured repository roots If the specified url doesn't match any of the roots, returns null.
      • configFile

        public Path configFile()
        The config directory.
      • pluginsFile

        public Path pluginsFile()
      • binFile

        public Path binFile()
      • libFile

        public Path libFile()
      • modulesFile

        public Path modulesFile()
      • logsFile

        public Path logsFile()
      • pidFile

        public Path pidFile()
        The PID file location (can be null if no PID file is configured)
      • tmpFile

        public Path tmpFile()
        Path to the default temp directory used by the JDK
      • validateTmpFile

        public void validateTmpFile()
                             throws IOException
        Ensure the configured temp directory is a valid directory
        Throws:
        IOException
      • assertEquivalent

        public static void assertEquivalent​(Environment actual,
                                            Environment expected)
        asserts that the two environments are equivalent for all things the environment cares about (i.e., all but the setting object which may contain different setting)