@@ -44,7 +44,7 @@ public class B2AuthorizeAccountResponse extends BaseB2Response {
4444 private final String apiUrl ;
4545 private final String authorizationToken ;
4646 private final String downloadUrl ;
47-
47+ private final int minimumPartSize ;
4848 /**
4949 * Instantiate an authorize account response with the JSON response as a
5050 * string from the API call. This response is then parsed into the
@@ -61,6 +61,7 @@ public B2AuthorizeAccountResponse(String json) throws B2ApiException {
6161 this .apiUrl = this .readString (B2ResponseProperties .KEY_API_URL );
6262 this .authorizationToken = this .readString (B2ResponseProperties .KEY_AUTHORIZATION_TOKEN );
6363 this .downloadUrl = this .readString (B2ResponseProperties .KEY_DOWNLOAD_URL );
64+ this .minimumPartSize = this .readInt (B2ResponseProperties .KEY_MINIMUM_PART_SIZE );
6465
6566 this .warnOnMissedKeys (LOGGER );
6667 }
@@ -95,13 +96,31 @@ public B2AuthorizeAccountResponse(String json) throws B2ApiException {
9596 */
9697 public String getDownloadUrl () { return this .downloadUrl ; }
9798
99+ /**
100+ * The minimum size for each part of a large file (except the last one). This
101+ * will always be 100,000,000, but we recommend that you write your code to
102+ * get the number here, rather than use a hard-coded constant.
103+ *
104+ * @return the minimum part size for downloads
105+ */
106+ public int getMinimumPartSize () {return this .minimumPartSize ; }
107+
98108 @ Override
99109 public String toString () {
100- final StringBuilder sb = new StringBuilder ("B2AuthorizeAccountResponse{" );
101- sb .append ("accountId='" ).append (accountId ).append ('\'' );
102- sb .append (", apiUrl='" ).append (apiUrl ).append ('\'' );
103- sb .append (", downloadUrl='" ).append (downloadUrl ).append ('\'' );
104- sb .append ('}' );
105- return sb .toString ();
110+ StringBuilder stringBuilder = new StringBuilder ();
111+ stringBuilder .append ("B2AuthorizeAccountResponse [accountId=" );
112+ stringBuilder .append (this .accountId );
113+ stringBuilder .append (", apiUrl=" );
114+ stringBuilder .append (this .apiUrl );
115+ stringBuilder .append (", authorizationToken=" );
116+ stringBuilder .append (this .authorizationToken );
117+ stringBuilder .append (", downloadUrl=" );
118+ stringBuilder .append (this .downloadUrl );
119+ stringBuilder .append (", minimumPartSize=" );
120+ stringBuilder .append (this .minimumPartSize );
121+ stringBuilder .append ("]" );
122+ return stringBuilder .toString ();
106123 }
124+
125+
107126}
0 commit comments