title: Is there any way to add progress bar for file-upload to dropbox using Java
body: <p>I was uploading file to dropbox using java. But the problem is how can I add progress bar to file upload to dropbox. I didn't use java script for it. I didn't get any of this in dropbox API.
  my code is.</p>
  
  <pre><code>import com.dropbox.core.*;
  import java.io.*;
  import java.util.Locale;
  public class Main {
  public static void main(String[] args) throws IOException, DbxException {
      // Get your app key and secret from the Dropbox developers website.
      final String APP_KEY = "INSERT_APP_KEY";
      final String APP_SECRET = "INSERT_APP_SECRET";
  
      DbxAppInfo appInfo = new DbxAppInfo(APP_KEY, APP_SECRET);
  
      DbxRequestConfig config = new DbxRequestConfig("JavaTutorial/1.0",
          Locale.getDefault().toString());
      DbxWebAuthNoRedirect webAuth = new DbxWebAuthNoRedirect(config, appInfo);
  
      // Have the user sign in and authorize your app.
      String authorizeUrl = webAuth.start();
      System.out.println("1. Go to: " + authorizeUrl);
      System.out.println("2. Click \"Allow\" (you might have to log in first)");
      System.out.println("3. Copy the authorization code.");
      String code = new BufferedReader(new InputStreamReader(System.in)).readLine().trim();
  
      // This will fail if the user enters an invalid authorization code.
      DbxAuthFinish authFinish = webAuth.finish(code);
      String accessToken = authFinish.accessToken;
  
      DbxClient client = new DbxClient(config, accessToken);
  
      System.out.println("Linked account: " + client.getAccountInfo().displayName);
  
      File inputFile = new File("working-draft.txt");
      FileInputStream inputStream = new FileInputStream(inputFile);
      try {
          DbxEntry.File uploadedFile = client.uploadFile("/magnum-opus.txt",
              DbxWriteMode.add(), inputFile.length(), inputStream);
          System.out.println("Uploaded: " + uploadedFile.toString());
      } finally {
          inputStream.close();
      }
  
      DbxEntry.WithChildren listing = client.getMetadataWithChildren("/");
      System.out.println("Files in the root path:");
      for (DbxEntry child : listing.children) {
          System.out.println("    " + child.name + ": " + child.toString());
      }
  
      FileOutputStream outputStream = new FileOutputStream("magnum-opus.txt");
      try {
          DbxEntry.File downloadedFile = client.getFile("/magnum-opus.txt", null,
              outputStream);
          System.out.println("Metadata: " + downloadedFile.toString());
      } finally {
          outputStream.close();
      }
  }
  </code></pre>