forked from docker-java/docker-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSaveImageCmdImpl.java
More file actions
60 lines (49 loc) · 1.39 KB
/
Copy pathSaveImageCmdImpl.java
File metadata and controls
60 lines (49 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
package com.github.dockerjava.core.command;
import static com.google.common.base.Preconditions.checkNotNull;
import java.io.InputStream;
import com.github.dockerjava.api.command.SaveImageCmd;
import com.github.dockerjava.api.exception.NotFoundException;
public class SaveImageCmdImpl extends AbstrDockerCmd<SaveImageCmd, InputStream> implements SaveImageCmd {
private String name;
private String tag;
public SaveImageCmdImpl(SaveImageCmd.Exec exec, String name) {
super(exec);
withName(name);
}
@Override
public String getName() {
return name;
}
@Override
public String getTag() {
return tag;
}
/**
* @param name
* The name, e.g. "alexec/busybox" or just "busybox" if you want to default. Not null.
*/
@Override
public SaveImageCmd withName(String name) {
checkNotNull(name, "name was not specified");
this.name = name;
return this;
}
/**
* @param tag
* The image's tag. Can be null or empty.
*/
@Override
public SaveImageCmd withTag(String tag) {
checkNotNull(tag, "tag was not specified");
this.tag = tag;
return this;
}
/**
* @throws NotFoundException
* No such image
*/
@Override
public InputStream exec() throws NotFoundException {
return super.exec();
}
}