• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

box / box-java-sdk / #3930

15 Jul 2024 09:25AM CUT coverage: 72.44%. Remained the same
#3930

push

github

web-flow
test: Add test for uploading file using stream (#1258)

Closes: SDK-3898

7683 of 10606 relevant lines covered (72.44%)

0.72 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/main/java/com/box/sdk/BoxZipDownloadStatus.java
1
package com.box.sdk;
2

3
import com.eclipsesource.json.JsonObject;
4
import com.eclipsesource.json.JsonValue;
5

6
/**
7
 * Represents the download status of a zip file.
8
 */
9
public class BoxZipDownloadStatus extends BoxJSONObject {
10
    private int totalFileCount;
11
    private int downloadFileCount;
12
    private int skippedFileCount;
13
    private int skippedFolderCount;
14
    private State state;
15

16
    /**
17
     * Constructs a BoxZipDownloadStatus with default settings.
18
     */
19
    public BoxZipDownloadStatus() {
×
20
    }
×
21

22
    /**
23
     * Constructs a BoxZipDownloadStatus from a JSON string.
24
     *
25
     * @param json the JSON encoded enterprise.
26
     */
27
    public BoxZipDownloadStatus(String json) {
28
        super(json);
×
29
    }
×
30

31
    BoxZipDownloadStatus(JsonObject jsonObject) {
32
        super(jsonObject);
×
33
    }
×
34

35
    /**
36
     * Gets the total number of files in the zip.
37
     *
38
     * @return the total number of files in the zip.
39
     */
40
    public int getTotalFileCount() {
41
        return this.totalFileCount;
×
42
    }
43

44
    /**
45
     * Gets the number of files in the zip that were downloaded.
46
     *
47
     * @return the number of files in the zip that were downloaded.
48
     */
49
    public int getDownloadFileCount() {
50
        return this.downloadFileCount;
×
51
    }
52

53
    /**
54
     * Gets the number of files in the zip that were skipped when downloading.
55
     *
56
     * @return the number of files in the zip that were skipped when downloading.
57
     */
58
    public int getSkippedFileCount() {
59
        return this.skippedFileCount;
×
60
    }
61

62
    /**
63
     * Gets the number of folders in the zip that were skipped when downloading.
64
     *
65
     * @return the number of folder in the zip that were skipped when downloading.
66
     */
67
    public int getSkippedFolderCount() {
68
        return this.skippedFolderCount;
×
69
    }
70

71
    /**
72
     * Gets the state of the download for the zip file.
73
     *
74
     * @return the state of the download for the zip file
75
     */
76
    public State getState() {
77
        return this.state;
×
78
    }
79

80
    @Override
81
    void parseJSONMember(JsonObject.Member member) {
82
        JsonValue value = member.getValue();
×
83
        String memberName = member.getName();
×
84
        if (memberName.equals("total_file_count")) {
×
85
            this.totalFileCount = value.asInt();
×
86
        } else if (memberName.equals("download_file_count")) {
×
87
            this.downloadFileCount = value.asInt();
×
88
        } else if (memberName.equals("skipped_file_count")) {
×
89
            this.skippedFileCount = value.asInt();
×
90
        } else if (memberName.equals("skipped_folder_count")) {
×
91
            this.skippedFolderCount = value.asInt();
×
92
        } else if (memberName.equals("state")) {
×
93
            this.state = State.fromJSONValue(value.asString());
×
94
        }
95
    }
×
96

97
    /**
98
     * Enumerates the possible download states of a zip.
99
     */
100
    public enum State {
×
101
        /**
102
         * Succeeded in downloading.
103
         */
104
        SUCCEEDED("succeeded"),
×
105

106
        /**
107
         * Downloading in progress.
108
         */
109
        IN_PROGRESS("in_progress"),
×
110

111
        /**
112
         * Failed when downloading.
113
         */
114
        FAILED("failed");
×
115

116
        private final String jsonValue;
117

118
        State(String jsonValue) {
×
119
            this.jsonValue = jsonValue;
×
120
        }
×
121

122
        static State fromJSONValue(String jsonValue) {
123
            return State.valueOf(jsonValue.toUpperCase());
×
124
        }
125

126
        String toJSONValue() {
127
            return this.jsonValue;
×
128
        }
129
    }
130
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc