001package com.box.sdk; 002 003import java.io.InputStream; 004import java.util.Date; 005 006/** 007 * Contains parameters for configuring an upload to Box. 008 */ 009public class FileUploadParams { 010 private InputStream content; 011 private String name; 012 private Date created; 013 private Date modified; 014 private long size; 015 private ProgressListener listener; 016 017 /** 018 * Constructs a new FileUploadParams with default parameters. 019 */ 020 public FileUploadParams() { } 021 022 /** 023 * Gets the content that will be uploaded to Box. 024 * @return an InputStream that reads the content to be uploaded to Box. 025 */ 026 public InputStream getContent() { 027 return this.content; 028 } 029 030 /** 031 * Sets the content that will be uploaded to Box. 032 * @param content an InputStream that reads from the content to be uploaded to Box. 033 * @return this FileUploadParams object for chaining. 034 */ 035 public FileUploadParams setContent(InputStream content) { 036 this.content = content; 037 return this; 038 } 039 040 /** 041 * Gets the name that will be given to the uploaded file. 042 * @return the name that will be given to the uploaded file. 043 */ 044 public String getName() { 045 return this.name; 046 } 047 048 /** 049 * Sets the name that will be given to the uploaded file. 050 * @param name the name that will be given to the uploaded file. 051 * @return this FileUploadParams object for chaining. 052 */ 053 public FileUploadParams setName(String name) { 054 this.name = name; 055 return this; 056 } 057 058 /** 059 * Gets the content created date that will be given to the uploaded file. 060 * @return the content created date that will be given to the uploaded file. 061 */ 062 public Date getCreated() { 063 return this.created; 064 } 065 066 /** 067 * Sets the content created date that will be given to the uploaded file. 068 * @param created the content created date that will be given to the uploaded file. 069 * @return this FileUploadParams object for chaining. 070 */ 071 public FileUploadParams setCreated(Date created) { 072 this.created = created; 073 return this; 074 } 075 076 /** 077 * Gets the content modified date that will be given to the uploaded file. 078 * @return the content modified date that will be given to the uploaded file. 079 */ 080 public Date getModified() { 081 return this.modified; 082 } 083 084 /** 085 * Sets the content modified date that will be given to the uploaded file. 086 * @param modified the content modified date that will be given to the uploaded file. 087 * @return this FileUploadParams object for chaining. 088 */ 089 public FileUploadParams setModified(Date modified) { 090 this.modified = modified; 091 return this; 092 } 093 094 /** 095 * Gets the size of the file's content used for monitoring the upload's progress. 096 * @return the size of the file's content. 097 */ 098 public long getSize() { 099 return this.size; 100 } 101 102 /** 103 * Sets the size of the file content used for monitoring the upload's progress. 104 * @param size the size of the file's content. 105 * @return this FileUploadParams object for chaining. 106 */ 107 public FileUploadParams setSize(long size) { 108 this.size = size; 109 return this; 110 } 111 112 /** 113 * Gets the ProgressListener that will be used for monitoring the upload's progress. 114 * @return the ProgressListener that will be used for monitoring the upload's progress. 115 */ 116 public ProgressListener getProgressListener() { 117 return this.listener; 118 } 119 120 /** 121 * Sets the ProgressListener that will be used for monitoring the upload's progress. 122 * @param listener the listener that will be used for monitoring the upload's progress. 123 * @return this FileUploadParams object for chaining. 124 */ 125 public FileUploadParams setProgressListener(ProgressListener listener) { 126 this.listener = listener; 127 return this; 128 } 129}