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

box / box-java-sdk / #6242

10 Feb 2026 05:27PM UTC coverage: 35.714% (+11.4%) from 24.324%
#6242

push

github

web-flow
fix(boxsdkgen): Move assigning default values from builder constructor to `build()` method (box/box-codegen#922) (#1712)

0 of 1677 new or added lines in 569 files covered. (0.0%)

2146 existing lines in 544 files now uncovered.

7382 of 20670 relevant lines covered (35.71%)

0.4 hits per line

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

0.0
/src/main/java/com/box/sdkgen/managers/folderwatermarks/FolderWatermarksManager.java
1
package com.box.sdkgen.managers.folderwatermarks;
2

3
import static com.box.sdkgen.internal.utils.UtilsManager.convertToString;
4
import static com.box.sdkgen.internal.utils.UtilsManager.mapOf;
5
import static com.box.sdkgen.internal.utils.UtilsManager.mergeMaps;
6
import static com.box.sdkgen.internal.utils.UtilsManager.prepareParams;
7

8
import com.box.sdkgen.networking.auth.Authentication;
9
import com.box.sdkgen.networking.fetchoptions.FetchOptions;
10
import com.box.sdkgen.networking.fetchoptions.ResponseFormat;
11
import com.box.sdkgen.networking.fetchresponse.FetchResponse;
12
import com.box.sdkgen.networking.network.NetworkSession;
13
import com.box.sdkgen.schemas.watermark.Watermark;
14
import com.box.sdkgen.serialization.json.JsonManager;
15
import java.util.Map;
16

17
public class FolderWatermarksManager {
18

19
  public Authentication auth;
20

21
  public NetworkSession networkSession;
22

23
  public FolderWatermarksManager() {
×
24
    this.networkSession = new NetworkSession();
×
25
  }
×
26

27
  protected FolderWatermarksManager(Builder builder) {
×
28
    this.auth = builder.auth;
×
29
    this.networkSession = builder.networkSession;
×
30
  }
×
31

32
  /**
33
   * Retrieve the watermark for a folder.
34
   *
35
   * @param folderId The unique identifier that represent a folder.
36
   *     <p>The ID for any folder can be determined by visiting this folder in the web application
37
   *     and copying the ID from the URL. For example, for the URL
38
   *     `https://*.app.box.com/folder/123` the `folder_id` is `123`.
39
   *     <p>The root folder of a Box account is always represented by the ID `0`. Example: "12345"
40
   */
41
  public Watermark getFolderWatermark(String folderId) {
42
    return getFolderWatermark(folderId, new GetFolderWatermarkHeaders());
×
43
  }
44

45
  /**
46
   * Retrieve the watermark for a folder.
47
   *
48
   * @param folderId The unique identifier that represent a folder.
49
   *     <p>The ID for any folder can be determined by visiting this folder in the web application
50
   *     and copying the ID from the URL. For example, for the URL
51
   *     `https://*.app.box.com/folder/123` the `folder_id` is `123`.
52
   *     <p>The root folder of a Box account is always represented by the ID `0`. Example: "12345"
53
   * @param headers Headers of getFolderWatermark method
54
   */
55
  public Watermark getFolderWatermark(String folderId, GetFolderWatermarkHeaders headers) {
56
    Map<String, String> headersMap = prepareParams(mergeMaps(mapOf(), headers.getExtraHeaders()));
×
57
    FetchResponse response =
×
58
        this.networkSession
59
            .getNetworkClient()
×
60
            .fetch(
×
61
                new FetchOptions.Builder(
62
                        String.join(
×
63
                            "",
64
                            this.networkSession.getBaseUrls().getBaseUrl(),
×
65
                            "/2.0/folders/",
66
                            convertToString(folderId),
×
67
                            "/watermark"),
68
                        "GET")
69
                    .headers(headersMap)
×
70
                    .responseFormat(ResponseFormat.JSON)
×
71
                    .auth(this.auth)
×
72
                    .networkSession(this.networkSession)
×
73
                    .build());
×
74
    return JsonManager.deserialize(response.getData(), Watermark.class);
×
75
  }
76

77
  /**
78
   * Applies or update a watermark on a folder.
79
   *
80
   * @param folderId The unique identifier that represent a folder.
81
   *     <p>The ID for any folder can be determined by visiting this folder in the web application
82
   *     and copying the ID from the URL. For example, for the URL
83
   *     `https://*.app.box.com/folder/123` the `folder_id` is `123`.
84
   *     <p>The root folder of a Box account is always represented by the ID `0`. Example: "12345"
85
   * @param requestBody Request body of updateFolderWatermark method
86
   */
87
  public Watermark updateFolderWatermark(
88
      String folderId, UpdateFolderWatermarkRequestBody requestBody) {
89
    return updateFolderWatermark(folderId, requestBody, new UpdateFolderWatermarkHeaders());
×
90
  }
91

92
  /**
93
   * Applies or update a watermark on a folder.
94
   *
95
   * @param folderId The unique identifier that represent a folder.
96
   *     <p>The ID for any folder can be determined by visiting this folder in the web application
97
   *     and copying the ID from the URL. For example, for the URL
98
   *     `https://*.app.box.com/folder/123` the `folder_id` is `123`.
99
   *     <p>The root folder of a Box account is always represented by the ID `0`. Example: "12345"
100
   * @param requestBody Request body of updateFolderWatermark method
101
   * @param headers Headers of updateFolderWatermark method
102
   */
103
  public Watermark updateFolderWatermark(
104
      String folderId,
105
      UpdateFolderWatermarkRequestBody requestBody,
106
      UpdateFolderWatermarkHeaders headers) {
107
    Map<String, String> headersMap = prepareParams(mergeMaps(mapOf(), headers.getExtraHeaders()));
×
108
    FetchResponse response =
×
109
        this.networkSession
110
            .getNetworkClient()
×
111
            .fetch(
×
112
                new FetchOptions.Builder(
113
                        String.join(
×
114
                            "",
115
                            this.networkSession.getBaseUrls().getBaseUrl(),
×
116
                            "/2.0/folders/",
117
                            convertToString(folderId),
×
118
                            "/watermark"),
119
                        "PUT")
120
                    .headers(headersMap)
×
121
                    .data(JsonManager.serialize(requestBody))
×
122
                    .contentType("application/json")
×
123
                    .responseFormat(ResponseFormat.JSON)
×
124
                    .auth(this.auth)
×
125
                    .networkSession(this.networkSession)
×
126
                    .build());
×
127
    return JsonManager.deserialize(response.getData(), Watermark.class);
×
128
  }
129

130
  /**
131
   * Removes the watermark from a folder.
132
   *
133
   * @param folderId The unique identifier that represent a folder.
134
   *     <p>The ID for any folder can be determined by visiting this folder in the web application
135
   *     and copying the ID from the URL. For example, for the URL
136
   *     `https://*.app.box.com/folder/123` the `folder_id` is `123`.
137
   *     <p>The root folder of a Box account is always represented by the ID `0`. Example: "12345"
138
   */
139
  public void deleteFolderWatermark(String folderId) {
140
    deleteFolderWatermark(folderId, new DeleteFolderWatermarkHeaders());
×
141
  }
×
142

143
  /**
144
   * Removes the watermark from a folder.
145
   *
146
   * @param folderId The unique identifier that represent a folder.
147
   *     <p>The ID for any folder can be determined by visiting this folder in the web application
148
   *     and copying the ID from the URL. For example, for the URL
149
   *     `https://*.app.box.com/folder/123` the `folder_id` is `123`.
150
   *     <p>The root folder of a Box account is always represented by the ID `0`. Example: "12345"
151
   * @param headers Headers of deleteFolderWatermark method
152
   */
153
  public void deleteFolderWatermark(String folderId, DeleteFolderWatermarkHeaders headers) {
154
    Map<String, String> headersMap = prepareParams(mergeMaps(mapOf(), headers.getExtraHeaders()));
×
155
    FetchResponse response =
×
156
        this.networkSession
157
            .getNetworkClient()
×
158
            .fetch(
×
159
                new FetchOptions.Builder(
160
                        String.join(
×
161
                            "",
162
                            this.networkSession.getBaseUrls().getBaseUrl(),
×
163
                            "/2.0/folders/",
164
                            convertToString(folderId),
×
165
                            "/watermark"),
166
                        "DELETE")
167
                    .headers(headersMap)
×
168
                    .responseFormat(ResponseFormat.NO_CONTENT)
×
169
                    .auth(this.auth)
×
170
                    .networkSession(this.networkSession)
×
171
                    .build());
×
172
  }
×
173

174
  public Authentication getAuth() {
175
    return auth;
×
176
  }
177

178
  public NetworkSession getNetworkSession() {
179
    return networkSession;
×
180
  }
181

182
  public static class Builder {
183

184
    protected Authentication auth;
185

186
    protected NetworkSession networkSession;
187

NEW
188
    public Builder() {}
×
189

190
    public Builder auth(Authentication auth) {
UNCOV
191
      this.auth = auth;
×
UNCOV
192
      return this;
×
193
    }
194

195
    public Builder networkSession(NetworkSession networkSession) {
UNCOV
196
      this.networkSession = networkSession;
×
UNCOV
197
      return this;
×
198
    }
199

200
    public FolderWatermarksManager build() {
NEW
201
      if (this.networkSession == null) {
×
NEW
202
        this.networkSession = new NetworkSession();
×
203
      }
204
      return new FolderWatermarksManager(this);
×
205
    }
206
  }
207
}
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

© 2026 Coveralls, Inc