001package com.box.sdk; 002 003import java.net.URL; 004 005/** 006 * <p>Used to make HTTP multipart requests to the Box API.</p> 007 * 008 * <p>This class partially implements the HTTP multipart standard in order to upload files to Box. The body of this 009 * request type cannot be set directly. Instead, it can be modified by adding multipart fields and setting file 010 * contents. The body of multipart requests will not be logged since they are likely to contain binary data.</p> 011 */ 012public class BoxMultipartRequest extends AbstractBoxMultipartRequest { 013 014 /** 015 * Constructs an authenticated BoxMultipartRequest using a provided BoxAPIConnection. 016 * 017 * @param api an API connection for authenticating the request. 018 * @param url the URL of the request. 019 */ 020 public BoxMultipartRequest(BoxAPIConnection api, URL url) { 021 super(api, url); 022 } 023 024 @Override 025 protected String getPartName() { 026 return "file"; 027 } 028 029 @Override 030 protected String getPartContentType(String filename) { 031 return "application/octet-stream"; 032 } 033}