Package io.fabric8.maven.docker.util
Class DockerPathUtil
- java.lang.Object
-
- io.fabric8.maven.docker.util.DockerPathUtil
-
public class DockerPathUtil extends Object
Docker path resolution and manipulation utility methods.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 Summary
Constructors Constructor Description DockerPathUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static FileresolveAbsolutely(String pathToResolve, String baseDir)Resolves the supplied resource (a path or directory on the filesystem) relative the suppliedbaseDir.
-
-
-
Method Detail
-
resolveAbsolutely
public static File resolveAbsolutely(String pathToResolve, String baseDir)
Resolves the supplied resource (a path or directory on the filesystem) relative the suppliedbaseDir. The returnedFileis guaranteed to beabsolute. The returned file is not guaranteed to exist.If the supplied
pathToResolveis alreadyabsolute, then it is returned unmodified. Otherwise, thepathToResolveis returned as an absoluteFileusing the suppliedbaseDiras its parent.- Parameters:
pathToResolve- represents a filesystem resource, which may be an absolute pathbaseDir- the absolute path used to resolve non-absolute path resources; must be absolute- Returns:
- an absolute
Filereference topathToResolve; not guaranteed to exist - Throws:
IllegalArgumentException- if the suppliedbaseDirdoes not represent an absolute path
-
-