forked from docker-java/docker-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLoadImageAsyncCmdImpl.java
More file actions
41 lines (32 loc) · 1.09 KB
/
Copy pathLoadImageAsyncCmdImpl.java
File metadata and controls
41 lines (32 loc) · 1.09 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
package com.github.dockerjava.core.command;
import com.github.dockerjava.api.command.LoadImageAsyncCmd;
import com.github.dockerjava.api.model.LoadResponseItem;
import java.io.IOException;
import java.io.InputStream;
import java.util.Objects;
public class LoadImageAsyncCmdImpl extends AbstrAsyncDockerCmd<LoadImageAsyncCmd, LoadResponseItem> implements LoadImageAsyncCmd {
private InputStream inputStream;
public LoadImageAsyncCmdImpl(LoadImageAsyncCmd.Exec exec, InputStream inputStream) {
super(exec);
this.inputStream = inputStream;
}
@Override
public InputStream getImageStream() {
return this.inputStream;
}
@Override
public LoadImageAsyncCmd withImageStream(InputStream imageStream) {
Objects.requireNonNull(imageStream, "imageStream was not specified");
this.inputStream = imageStream;
return this;
}
@Override
public void close() {
super.close();
try {
this.inputStream.close();
} catch (IOException e) {
throw new RuntimeException(e);
}
}
}