public class Volume extends Object implements Serializable
Due to an inconsistency in the Docker REST API implementation the response to a container
command might include either "Mounts" : [ { "Destination" : "/path/to/mount" } ]
or
"Mounts" : [ { "Destination" : { "path" : "/path/to/mount" } } ]
JSON snippets. However,
both variants have to be mapped to this class. Therefore, both a single-argument constructor
as well as a single-argument factory method is provided either of which handles the former or
latter variant (with path
key), respectively.
Bind
,
Serialized FormConstructor and Description |
---|
Volume(String path)
Creates a volume referring to the given path.
|
Modifier and Type | Method and Description |
---|---|
String |
getPath() |
static Volume |
parse(Map<String,String> primitive)
Handles the
{ "Destination" : { "path" : "/path/to/mount" } } variant. |
static Volume |
parse(String path)
Deprecated.
use
parse(Map) |
String |
toString() |
public Volume(String path)
{ "Destination" : "/path/to/mount" }
variant.path
- the destination path of the bind mounted volume@Nonnull @Deprecated public static Volume parse(String path)
parse(Map)
{ "Destination" : { "path" : "/path/to/mount" } }
variant.path
- the destination path of the bind mounted volume@Nonnull public static Volume parse(Map<String,String> primitive)
{ "Destination" : { "path" : "/path/to/mount" } }
variant.path
- the destination path of the bind mounted volumepublic String getPath()
Copyright © 2021. All rights reserved.