Package org.apache.commons.lang3
Class RuntimeEnvironment
java.lang.Object
org.apache.commons.lang3.RuntimeEnvironment
Helps query the runtime environment.
- Since:
- 3.15.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static Boolean
containsLine
(String path, String line) Tests whether the file at the given path string contains a specific line.static Boolean
Tests whether we are running in a container like Docker or Podman.(package private) static Boolean
inDocker()
Tests whether we are running in a Docker container.(package private) static Boolean
inPodman()
Tests whether we are running in a Podman container.(package private) static Boolean
inWsl()
Tests whether we are running in a Windows Subsystem for Linux (WSL).
-
Constructor Details
-
RuntimeEnvironment
Deprecated.Will be removed in 4.0.0.Constructs a new instance.
-
-
Method Details
-
containsLine
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
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
Tests whether we are running in a Docker container.Package-private for testing.
- Returns:
- whether we are running in a Docker container.
-
inPodman
Tests whether we are running in a Podman container.Package-private for testing.
- Returns:
- whether we are running in a Podman container.
-
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).
-