File tree Expand file tree Collapse file tree
example/src/main/java/io/tus/java/example Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1818import java .util .Map ;
1919
2020public final class Api2DevdockTusUpload {
21+ /**
22+ * Run the API2 devdock TUS upload example.
23+ *
24+ * @param args ignored
25+ */
2126 public static void main (String [] args ) {
2227 try {
2328 System .setProperty ("http.strictPostRedirect" , "true" );
@@ -68,9 +73,10 @@ private static String uploadWithTus(
6873
6974 final TusUploader uploader = client .resumeOrCreateUpload (upload );
7075 uploader .setChunkSize (content .length );
71- while (uploader .uploadChunk () > -1 ) {
72- // Continue until the client reports that the source is fully uploaded.
73- }
76+ int uploadedChunkSize ;
77+ do {
78+ uploadedChunkSize = uploader .uploadChunk ();
79+ } while (uploadedChunkSize > -1 );
7480 uploader .finish ();
7581
7682 if (uploader .getOffset () != content .length ) {
You can’t perform that action at this time.
0 commit comments