1515import com .dropbox .core .v2 .files .UploadErrorException ;
1616import com .dropbox .core .v2 .files .UploadSessionCursor ;
1717import com .dropbox .core .v2 .files .UploadSessionFinishErrorException ;
18- import com .dropbox .core .v2 .files .UploadSessionLookupErrorException ;
1918import com .dropbox .core .v2 .files .WriteMode ;
2019
2120import java .io .File ;
@@ -42,7 +41,7 @@ public class Main {
4241 * eliminates unnecessary round-trips to the servers.
4342 *
4443 * @param dbxClient Dropbox user authenticated client
45- * @param localFIle local file to upload
44+ * @param localFile local file to upload
4645 * @param dropboxPath Where to upload the file to within Dropbox
4746 */
4847 private static void uploadFile (DbxClientV2 dbxClient , File localFile , String dropboxPath ) {
@@ -74,7 +73,7 @@ private static void uploadFile(DbxClientV2 dbxClient, File localFile, String dro
7473 * to re-upload all the bytes).
7574 *
7675 * @param dbxClient Dropbox user authenticated client
77- * @param localFIle local file to upload
76+ * @param localFile local file to upload
7877 * @param dropboxPath Where to upload the file to within Dropbox
7978 */
8079 private static void chunkedUploadFile (DbxClientV2 dbxClient , File localFile , String dropboxPath ) {
@@ -158,21 +157,6 @@ public void onProgress(long l) {
158157 thrown = ex ;
159158 // network issue with Dropbox (maybe a timeout?) try again
160159 continue ;
161- } catch (UploadSessionLookupErrorException ex ) {
162- if (ex .errorValue .isIncorrectOffset ()) {
163- thrown = ex ;
164- // server offset into the stream doesn't match our offset (uploaded). Seek to
165- // the expected offset according to the server and try again.
166- uploaded = ex .errorValue
167- .getIncorrectOffsetValue ()
168- .getCorrectOffset ();
169- continue ;
170- } else {
171- // Some other error occurred, give up.
172- System .err .println ("Error uploading to Dropbox: " + ex .getMessage ());
173- System .exit (1 );
174- return ;
175- }
176160 } catch (UploadSessionFinishErrorException ex ) {
177161 if (ex .errorValue .isLookupFailed () && ex .errorValue .getLookupFailedValue ().isIncorrectOffset ()) {
178162 thrown = ex ;
0 commit comments