public abstract class BasicDockerMapper extends Object implements DockerMountMapper
Constructor and Description |
---|
BasicDockerMapper() |
Modifier and Type | Method and Description |
---|---|
String |
asInnerPath(String path)
Convert path to inner path form.
|
String |
asOuterPath(String innerPath)
Convert path to outer path form.
|
protected String |
formatConfigPath(String path)
Give a path as it appears in the config file, convert it to a form suitable for matching to map keys.
|
protected String |
formatHostPath(String path)
Given a path as it appears in the Docker inspect Mount host info, convert the path to a form suitable for the map as a key.
|
protected String |
formatInnerPath(String path)
Given a path as it appears in the target portion of a Mount entry, convert the path to a form suitable for the map a value.
|
protected String |
getDockerInfoCmd() |
TreeMap<String,String> |
getMap()
The map at represents the connection of inner path to outer path.
|
protected boolean |
isParentDir(String parent,
String child) |
protected void |
makeVolMap()
This map is a link between file paths inside the container (the containerized path) and paths outside the
container (the decontainerized path).
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
builtForVersion, version
public BasicDockerMapper() throws DockerVolCreationException
DockerVolCreationException
protected void makeVolMap() throws DockerVolCreationException
DockerVolCreationException
protected String formatHostPath(String path)
path
- A path taken from the host part of a Mount entry in the docker info.protected String formatInnerPath(String path)
path
- A path taken from the target/destination part of a Mount entry in the docker info.protected String formatConfigPath(String path)
path
- A path taken from the config file. Relative paths should already be converted to absolute paths.protected String getDockerInfoCmd() throws IOException, DockerVolCreationException
IOException
DockerVolCreationException
public TreeMap<String,String> getMap()
DockerMountMapper
getMap
in interface DockerMountMapper
getMap
in interface PathMapper
public String asInnerPath(String path) throws DockerVolCreationException
DockerMountMapper
asInnerPath
in interface DockerMountMapper
asInnerPath
in interface PathMapper
path
- A path represented as a String, representing the outer path formDockerVolCreationException
public String asOuterPath(String innerPath) throws DockerVolCreationException
DockerMountMapper
asOuterPath
in interface DockerMountMapper
asOuterPath
in interface PathMapper
innerPath
- A path represented as a String, representing the inner path formDockerVolCreationException