Class RuntimeEnvironment

java.lang.Object
org.apache.commons.lang3.RuntimeEnvironment

public class RuntimeEnvironment extends Object
Helps query the runtime environment.
Since:
3.15.0
  • Constructor Details

    • RuntimeEnvironment

      @Deprecated public RuntimeEnvironment()
      Deprecated.
      Will be removed in 4.0.0.
      Constructs a new instance.
  • Method Details

    • containsLine

      private static Boolean containsLine(String path, String line)
      Tests whether the file at the given path string contains a specific line.
      Parameters:
      path - The path to a file.
      line - The line to find.
      Returns:
      whether the file at the given path string contains a specific line.
    • inContainer

      public static Boolean inContainer()
      Tests whether we are running in a container like Docker or Podman.
      Returns:
      whether we are running in a container like Docker or Podman.
    • inDocker

      static Boolean inDocker()
      Tests whether we are running in a Docker container.

      Package-private for testing.

      Returns:
      whether we are running in a Docker container.
    • inPodman

      static Boolean inPodman()
      Tests whether we are running in a Podman container.

      Package-private for testing.

      Returns:
      whether we are running in a Podman container.
    • inWsl

      static Boolean inWsl()
      Tests whether we are running in a Windows Subsystem for Linux (WSL).

      Package-private for testing.

      Returns:
      whether we are running in a Windows Subsystem for Linux (WSL).