forked from docker-java/docker-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPullResponseItem.java
More file actions
40 lines (30 loc) · 1.32 KB
/
Copy pathPullResponseItem.java
File metadata and controls
40 lines (30 loc) · 1.32 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
package com.github.dockerjava.api.model;
import com.fasterxml.jackson.annotation.JsonIgnore;
/**
* Represents a pull response stream item
*/
public class PullResponseItem extends ResponseItem {
private static final long serialVersionUID = -2575482839766823293L;
private static final String LEGACY_REGISTRY = "this image was pulled from a legacy registry";
private static final String DOWNLOADED_NEWER_IMAGE = "Downloaded newer image";
private static final String IMAGE_UP_TO_DATE = "Image is up to date";
private static final String DOWNLOAD_COMPLETE = "Download complete";
private static final String DOWNLOADED_SWARM = ": downloaded";
/**
* Returns whether the status indicates a successful pull operation
*
* @returns true: status indicates that pull was successful, false: status doesn't indicate a successful pull
*/
@JsonIgnore
public boolean isPullSuccessIndicated() {
if (isErrorIndicated() || getStatus() == null) {
return false;
}
return (getStatus().contains(DOWNLOAD_COMPLETE) ||
getStatus().contains(IMAGE_UP_TO_DATE) ||
getStatus().contains(DOWNLOADED_NEWER_IMAGE) ||
getStatus().contains(LEGACY_REGISTRY) ||
getStatus().contains(DOWNLOADED_SWARM)
);
}
}