public class DockerPathUtil extends Object
This class provides methods for manipulating paths as they appear in docker-compose or Dockerfiles. This class does not provide for generic path manipulation across platforms or file systems. Paths that appear in Docker configurations use forward slash as a separator character, so this class makes no provisions for handling Windows platform path semantics (e.g. the presence of drive letters or backward slash).
| Constructor and Description |
|---|
DockerPathUtil() |
| Modifier and Type | Method and Description |
|---|---|
static File |
resolveAbsolutely(String pathToResolve,
String baseDir)
Resolves the supplied resource (a path or directory on the filesystem) relative the supplied
baseDir. |
public static File resolveAbsolutely(String pathToResolve, String baseDir)
baseDir. The returned File is guaranteed to be absolute. The returned file
is not guaranteed to exist.
If the supplied pathToResolve is already absolute, then it is returned
unmodified. Otherwise, the pathToResolve is returned as an absolute File using the
supplied baseDir as its parent.
pathToResolve - represents a filesystem resource, which may be an absolute pathbaseDir - the absolute path used to resolve non-absolute path resources; must be absoluteFile reference to pathToResolve; not guaranteed to existIllegalArgumentException - if the supplied baseDir does not represent an absolute pathCopyright © 2018. All rights reserved.