• 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/BoxRecents.java
1
package com.box.sdk;
2

3
import com.eclipsesource.json.JsonObject;
4

5
/**
6
 * Utility class to retrieve list of recent items.
7
 *
8
 * @see <a href="http://google.com">https://developer.box.com/reference#get-recent-items</a>
9
 */
10
public final class BoxRecents {
11

12
    /**
13
     * Recents URL Template.
14
     */
15
    public static final URLTemplate RECENTS_URL_TEMPLATE = new URLTemplate("recent_items");
×
16

17
    //Constructor is not allowed
18
    private BoxRecents() {
19
    }
20

21
    /**
22
     * Used to retrieve all collaborations associated with the item.
23
     *
24
     * @param api    BoxAPIConnection from the associated file.
25
     * @param limit  limit of items to be retrieved. Default is 100. Maximum is 1000
26
     * @param fields the optional fields to retrieve.
27
     * @return An iterable of BoxCollaboration.Info instances associated with the item.
28
     * @see <a href="http://google.com">https://developer.box.com/reference#get-recent-items</a>
29
     */
30
    public static BoxResourceIterable<BoxRecentItem> getRecentItems(final BoxAPIConnection api,
31
                                                                    int limit, String... fields) {
32
        QueryStringBuilder builder = new QueryStringBuilder();
×
33
        if (fields.length > 0) {
×
34
            builder.appendParam("fields", fields);
×
35
        }
36
        return new BoxResourceIterable<BoxRecentItem>(
×
37
            api, RECENTS_URL_TEMPLATE.buildWithQuery(api.getBaseURL(), builder.toString()),
×
38
            limit) {
×
39

40
            @Override
41
            protected BoxRecentItem factory(JsonObject jsonObject) {
42
                return new BoxRecentItem(jsonObject, api);
×
43
            }
44
        };
45
    }
46
}
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