### Question:
FileUpDown { public void uploadFile(DbxClientV2 dbxClient, File localFile, String dropboxPath) throws IOException, DbxException { try (InputStream in = new FileInputStream(localFile)) { FileMetadata metadata = dbxClient.files().uploadBuilder(dropboxPath) .withMode(WriteMode.ADD) .withClientModified(new Date(localFile.lastModified())) .uploadAndFinish(in); System.out.println(metadata.toStringMultiline()); } }  void uploadFile(DbxClientV2 dbxClient, File localFile, String dropboxPath); void download(DbxClientV2 dbxClient, File localFile, String dropboxPath);  }### Answer:
@Test public void testUploadFile() throws Exception { String ehs_token = "o9MMPWzWozsAAAAAAAA7LcZj4A4b2LG1e6YbezbZ7ZoeJO-n-Hzu-yLZbuNFxLIS"; Authorization auth = new Authorization(new KeyProviderFactory().keyProvider()); DbxClientV2 client = auth.createClient(ehs_token, DbxHost.DEFAULT); FileUpDown upDown = new FileUpDown(); File file = new File(getClass().getClassLoader().getResource("test_file.txt").getFile()); try(FileWriter w = new FileWriter(file, true); PrintWriter pw = new PrintWriter(w)) { pw.println(new Date()); } String path = "/1/test" + new Date().getTime() + ".txt"; upDown.uploadFile(client, file, path); upDown.download(client, new File("target/downloaded_file.txt"), path); }