forked from docker-java/docker-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLoadResponseItem.java
More file actions
33 lines (25 loc) · 829 Bytes
/
Copy pathLoadResponseItem.java
File metadata and controls
33 lines (25 loc) · 829 Bytes
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
package com.github.dockerjava.api.model;
import com.fasterxml.jackson.annotation.JsonIgnore;
public class LoadResponseItem extends ResponseItem {
private static final long serialVersionUID = 1L;
private static final String IMPORT_SUCCESS = "Loaded image:";
/**
* Returns whether the stream field indicates a successful build operation
*/
@JsonIgnore
public boolean isBuildSuccessIndicated() {
if (isErrorIndicated() || getStream() == null) {
return false;
}
return getStream().contains(IMPORT_SUCCESS);
}
@JsonIgnore
public String getMessage() {
if (!isBuildSuccessIndicated()) {
return null;
} else if (getStream().contains(IMPORT_SUCCESS)) {
return getStream();
}
return null;
}
}