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

box / box-java-sdk / #4423

19 Feb 2025 11:15AM UTC coverage: 71.967% (+0.04%) from 71.932%
#4423

Pull #1287

github

web-flow
Merge db72c1054 into 29b651987
Pull Request #1287: feat: Support `zstd` encoding

34 of 42 new or added lines in 3 files covered. (80.95%)

3 existing lines in 3 files now uncovered.

8192 of 11383 relevant lines covered (71.97%)

0.72 hits per line

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

62.5
/src/main/java/com/box/sdk/BoxGlobalSettings.java
1
package com.box.sdk;
2

3
/**
4
 * Global settings to apply to all API requests.
5
 */
6
public final class BoxGlobalSettings {
7
    private static int connectTimeout = 0;
1✔
8
    private static int readTimeout = 0;
1✔
9
    private static int maxRetryAttempts = BoxAPIConnection.DEFAULT_MAX_RETRIES;
1✔
10
    private static boolean useZstdCompression = true;
1✔
11

12
    private BoxGlobalSettings() {
13
    }
14

15
    /**
16
     * Returns the current global connect timeout.
17
     *
18
     * @return connect timeout
19
     */
20
    public static int getConnectTimeout() {
21
        return connectTimeout;
1✔
22
    }
23

24
    /**
25
     * Sets the global connect timeout.
26
     *
27
     * @param connectTimeout timeout in milliseconds
28
     */
29
    public static void setConnectTimeout(int connectTimeout) {
30
        BoxGlobalSettings.connectTimeout = connectTimeout;
×
31
    }
×
32

33
    /**
34
     * Returns the current global read timeout.
35
     *
36
     * @return read timeout
37
     */
38
    public static int getReadTimeout() {
39
        return readTimeout;
1✔
40
    }
41

42
    /**
43
     * Sets the global read timeout.
44
     *
45
     * @param readTimeout timeout in milliseconds
46
     */
47
    public static void setReadTimeout(int readTimeout) {
48
        BoxGlobalSettings.readTimeout = readTimeout;
×
49
    }
×
50

51

52
    /**
53
     * Returns the global maximum number of times an API request will be retried after an error response
54
     * is received.
55
     *
56
     * @return max number of request attempts
57
     */
58
    public static int getMaxRetryAttempts() {
59
        return maxRetryAttempts;
1✔
60
    }
61

62
    /**
63
     * Sets the global maximum number of times an API request will be retried after an error response
64
     * is received.
65
     *
66
     * @param attempts maximum number of request attempts
67
     */
68
    public static void setMaxRetryAttempts(int attempts) {
69
        BoxGlobalSettings.maxRetryAttempts = attempts;
1✔
70
    }
1✔
71

72
    /*
73
     * Returns the global settings for using Zstd compression.
74
     * @return true if Zstd compression is enabled, false otherwise
75
     */
76
    public static boolean getUseZstdCompression() {
77
        return useZstdCompression;
1✔
78
    }
79

80
    /*
81
     * Sets the global settings for using Zstd compression.
82
     * @param useZstdCompression true to enable Zstd compression, false otherwise
83
     */
84
    public static void setUseZstdCompression(boolean useZstdCompression) {
NEW
85
        BoxGlobalSettings.useZstdCompression = useZstdCompression;
×
NEW
86
    }
×
87
}
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