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

box / box-java-sdk / #5076

07 Oct 2025 12:35PM UTC coverage: 37.132% (+0.007%) from 37.125%
#5076

push

github

web-flow
test: Change `Event.additionalDetails` field assertion in events test (box/box-codegen#858) (#1491)

18454 of 49699 relevant lines covered (37.13%)

0.37 hits per line

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

34.78
/src/main/java/com/box/sdkgen/managers/uploads/UploadFileRequestBody.java
1
package com.box.sdkgen.managers.uploads;
2

3
import java.io.InputStream;
4

5
public class UploadFileRequestBody {
6

7
  /**
8
   * The additional attributes of the file being uploaded. Mainly the name and the parent folder.
9
   * These attributes are part of the multi part request body and are in JSON format.
10
   *
11
   * <p>&lt;Message warning&gt;
12
   *
13
   * <p>The `attributes` part of the body must come **before** the `file` part. Requests that do not
14
   * follow this format when uploading the file will receive a HTTP `400` error with a
15
   * `metadata_after_file_contents` error code.
16
   *
17
   * <p>&lt;/Message&gt;
18
   */
19
  public final UploadFileRequestBodyAttributesField attributes;
20

21
  /**
22
   * The content of the file to upload to Box.
23
   *
24
   * <p>&lt;Message warning&gt;
25
   *
26
   * <p>The `attributes` part of the body must come **before** the `file` part. Requests that do not
27
   * follow this format when uploading the file will receive a HTTP `400` error with a
28
   * `metadata_after_file_contents` error code.
29
   *
30
   * <p>&lt;/Message&gt;
31
   */
32
  public final InputStream file;
33

34
  public String fileFileName;
35

36
  public String fileContentType;
37

38
  public UploadFileRequestBody(UploadFileRequestBodyAttributesField attributes, InputStream file) {
1✔
39
    this.attributes = attributes;
1✔
40
    this.file = file;
1✔
41
  }
1✔
42

43
  protected UploadFileRequestBody(Builder builder) {
×
44
    this.attributes = builder.attributes;
×
45
    this.file = builder.file;
×
46
    this.fileFileName = builder.fileFileName;
×
47
    this.fileContentType = builder.fileContentType;
×
48
  }
×
49

50
  public UploadFileRequestBodyAttributesField getAttributes() {
51
    return attributes;
1✔
52
  }
53

54
  public InputStream getFile() {
55
    return file;
1✔
56
  }
57

58
  public String getFileFileName() {
59
    return fileFileName;
1✔
60
  }
61

62
  public String getFileContentType() {
63
    return fileContentType;
1✔
64
  }
65

66
  public static class Builder {
67

68
    protected final UploadFileRequestBodyAttributesField attributes;
69

70
    protected final InputStream file;
71

72
    protected String fileFileName;
73

74
    protected String fileContentType;
75

76
    public Builder(UploadFileRequestBodyAttributesField attributes, InputStream file) {
×
77
      this.attributes = attributes;
×
78
      this.file = file;
×
79
    }
×
80

81
    public Builder fileFileName(String fileFileName) {
82
      this.fileFileName = fileFileName;
×
83
      return this;
×
84
    }
85

86
    public Builder fileContentType(String fileContentType) {
87
      this.fileContentType = fileContentType;
×
88
      return this;
×
89
    }
90

91
    public UploadFileRequestBody build() {
92
      return new UploadFileRequestBody(this);
×
93
    }
94
  }
95
}
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