forked from docker-java/docker-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPushImageCmdImpl.java
More file actions
53 lines (43 loc) · 1.24 KB
/
Copy pathPushImageCmdImpl.java
File metadata and controls
53 lines (43 loc) · 1.24 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
package com.github.dockerjava.core.command;
import java.io.InputStream;
import com.github.dockerjava.api.NotFoundException;
import com.github.dockerjava.api.command.PushImageCmd;
import com.google.common.base.Preconditions;
/**
* Push the latest image to the repository.
*
* @param name The name, e.g. "alexec/busybox" or just "busybox" if you want to default. Not null.
*/
public class PushImageCmdImpl extends AbstrAuthCfgDockerCmd<PushImageCmd, InputStream> implements PushImageCmd {
private String name;
public PushImageCmdImpl(PushImageCmd.Exec exec, String name) {
super(exec);
withName(name);
}
@Override
public String getName() {
return name;
}
/**
* @param name The name, e.g. "alexec/busybox" or just "busybox" if you want to default. Not null.
*/
@Override
public PushImageCmd withName(String name) {
Preconditions.checkNotNull(name, "name was not specified");
this.name = name;
return this;
}
@Override
public String toString() {
return new StringBuilder("push ")
.append(name)
.toString();
}
/**
* @throws NotFoundException No such image
*/
@Override
public InputStream exec() throws NotFoundException {
return super.exec();
}
}