Class SystemUtils

java.lang.Object
org.apache.juneau.commons.utils.SystemUtils

public class SystemUtils extends Object
System utilities.
  • Method Details

    • shutdownMessage

      public static void shutdownMessage(Supplier<String> message)
      Adds a console message to display when the JVM shuts down.
      Parameters:
      message - The message to display. Must not be null (evaluated at JVM shutdown).
    • env

      public static StringSetting env(String name)
      Looks up a system property or environment variable.
      Parameters:
      name - The property name.
      Returns:
      A StringSetting wrapping the value.
    • env

      public static <T> T env(String name, T def)
      Looks up a system property or environment variable, returning a default if not found.
      Type Parameters:
      T - The type to convert the value to.
      Parameters:
      name - The property name.
      def - The default value. Can be null (returned as-is when the property is not found).
      Returns:
      The found value, or the default.