Package org.apache.commons.lang3
Class RuntimeEnvironment
- java.lang.Object
-
- org.apache.commons.lang3.RuntimeEnvironment
-
public class RuntimeEnvironment extends java.lang.ObjectHelps query the runtime environment.- Since:
- 3.15.0
-
-
Constructor Summary
Constructors Constructor Description RuntimeEnvironment()Deprecated.Will be removed in 4.0.0.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static java.lang.BooleancontainsLine(java.lang.String path, java.lang.String line)Tests whether the file at the given path string contains a specific line.static java.lang.BooleaninContainer()Tests whether we are running in a container like Docker or Podman.(package private) static java.lang.BooleaninDocker()Tests whether we are running in a Docker container.(package private) static java.lang.BooleaninPodman()Tests whether we are running in a Podman container.(package private) static java.lang.BooleaninWsl()Tests whether we are running in a Windows Subsystem for Linux (WSL).
-
-
-
Method Detail
-
containsLine
private static java.lang.Boolean containsLine(java.lang.String path, java.lang.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 java.lang.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 java.lang.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 java.lang.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 java.lang.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).
-
-