cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Download a file or directory

Download a file or directory

Kid
New member | Level 2

Hey guys,

 

actually I am trying to program a Java application which can enter dropbox, look up which directories and files exist, upload a file and download a directory. Unfortunately I have some problems with the downloading part.

Every time I try to download  only a file the  it tells me that:

 

Exception in thread "main" java.io.FileNotFoundException: \test.txt (Zugriff verweigert)
at java.io.FileOutputStream.open0(Native Method)
at java.io.FileOutputStream.open(Unknown Source)
at java.io.FileOutputStream.<init>(Unknown Source)
at java.io.FileOutputStream.<init>(Unknown Source)
at Dropbox.downloadFile(Dropbox.java:73)
at Main.main(Main.java:15)

 

But I know that this file exists. here is the code for the downloading function

 

public void downloadFile(String path) throws ListFolderErrorException, DbxException, IOException
{
      FileOutputStream out = new FileOutputStream("/test.txt");
      DbxDownloader<FileMetadata> downloader = null;
      FileMetadata response;

      response = downloader.getResult();
      try {
            InputStream in = downloader.getInputStream();
      } finally {
            downloader.close();
      }
}

 

Can someonehelp me with that? I can't really find an answer in web.

1 Reply 1

Greg-DB
Dropbox Staff

Based on the stack trace, this error is ocuring in the "new FileOutputStream" line, and not in Dropbox code, so I'm afraid I can't offer much insight.

 

That said, the "Zugriff verweigert" error seems to translate to "Access denied", so it may be a permissions issue. You'll need to investigate why you don't have permission to access that file, and fix it so that you can.

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?