001package com.box.sdkgen.managers.uploads;
002
003import static com.box.sdkgen.internal.utils.UtilsManager.mapOf;
004
005import java.util.Map;
006
007public class UploadFileHeaders {
008
009  /**
010   * An optional header containing the SHA1 hash of the file to ensure that the file was not
011   * corrupted in transit.
012   */
013  public String contentMd5;
014
015  /** Extra headers that will be included in the HTTP request. */
016  public Map<String, String> extraHeaders;
017
018  public UploadFileHeaders() {
019    this.extraHeaders = mapOf();
020  }
021
022  protected UploadFileHeaders(Builder builder) {
023    this.contentMd5 = builder.contentMd5;
024    this.extraHeaders = builder.extraHeaders;
025  }
026
027  public String getContentMd5() {
028    return contentMd5;
029  }
030
031  public Map<String, String> getExtraHeaders() {
032    return extraHeaders;
033  }
034
035  public static class Builder {
036
037    protected String contentMd5;
038
039    protected Map<String, String> extraHeaders;
040
041    public Builder() {}
042
043    public Builder contentMd5(String contentMd5) {
044      this.contentMd5 = contentMd5;
045      return this;
046    }
047
048    public Builder extraHeaders(Map<String, String> extraHeaders) {
049      this.extraHeaders = extraHeaders;
050      return this;
051    }
052
053    public UploadFileHeaders build() {
054      if (this.extraHeaders == null) {
055        this.extraHeaders = mapOf();
056      }
057      return new UploadFileHeaders(this);
058    }
059  }
060}