Skip to content

Commit 1b580d2

Browse files
authored
Adding in cleanup API calls so that we don't run out of space. (#397)
1 parent 10d35db commit 1b580d2

File tree

1 file changed

+7
-0
lines changed
  • examples/upload-file/src/main/java/com/dropbox/core/examples/upload_file

1 file changed

+7
-0
lines changed

examples/upload-file/src/main/java/com/dropbox/core/examples/upload_file/Main.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,13 @@ public static void main(String[] args) throws IOException {
286286
} else {
287287
chunkedUploadFile(dbxClient, localFile, dropboxPath);
288288
}
289+
290+
try {
291+
// Delete the file we uploaded so we don't run out of space on the integration test account
292+
dbxClient.files().deleteV2(dropboxPath);
293+
} catch (DbxException e) {
294+
throw new RuntimeException("Could not cleanup the test file we just uploaded at " + dropboxPath, e);
295+
}
289296

290297
System.exit(0);
291298
}

0 commit comments

Comments
 (0)