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 booleanfileExists(String path) static BooleanTests whether we are running in a container like Docker or Podman.(package private) static booleaninContainer(String dirPrefix) private static StringTests whether the/proc/N/environfile at the given path string contains a specific line prefix.
-
Constructor Details
-
RuntimeEnvironment
Deprecated.Will be removed in 4.0.0.Constructs a new instance.
-
-
Method Details
-
fileExists
-
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. Never null
-
inContainer
-
readFile
Tests whether the/proc/N/environfile at the given path string contains a specific line prefix.- Parameters:
envVarFile- The path to a /proc/N/environ file.key- The env var key to find.- Returns:
- value The env var value or null.
-