This is a basic example for downloading a file that works with dropbox. it does not include the file download progress, it is just for direct file download.
This example uses the Dropbox v2 API with DbxClientV2
try
{
OutputStream downloadFile = new FileOutputStream("C:\\.....");
try
{
FileMetadata metadata = client.files().downloadBuilder("/root or foldername here/Koala.jpg")
.download(downloadFile);
}
finally
{
downloadFile.close();
}
}
catch (DbxException e)
{
JOptionPane.showMessageDialog(null, "Unable to download file to local system\n Error: " + e);
}
catch (IOException e)
{
JOptionPane.showMessageDialog(null, "Unable to download file to local system\n Error: " + e);
}
We hope this helps and uses this example and edits it to work the way you want it to work.
source
share