Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > Java
You last visited: Today at 20:28

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Dropbox Api

Discussion on Dropbox Api within the Java forum part of the Coders Den category.

Reply
 
Old   #1
 
Warnuk3r's Avatar
 
elite*gold: 307
Join Date: Jul 2009
Posts: 1,091
Received Thanks: 434
Dropbox Api

Sers, ich will mit der Dropbox Api Bilder etc. herunterladen. Wenn ich im Verzeichnis / mir ein Bild runterladen möchte klappt es. Wenn ich in /Ordnername das selbe Bild nochmal probiere, dann wird die Datei (jpg) bei mir auf dem PC erstellt, jedoch ist es leer. Ergibt für mich irgendwie keinen Sinn. Wenn ich keinen Zugriff hätte etc. dann würde auch dementsprechend ein Error kommen.

Code:
        DbxEntry.WithChildren listing = client.getMetadataWithChildren("/Test");
        System.out.println("Downloading...");
        for (DbxEntry child : listing.children) {
        	if(child.isFile()) {
	            System.out.println("	" + child.name + ": " + child.toString());
	            FileOutputStream outputStream = new FileOutputStream(child.name);
	            try {
	                DbxEntry.File downloadedFile = client.getFile("/"+child.name, null,
	                    outputStream);
	                System.out.println("Metadata: " + downloadedFile.toString());
	            } finally {
	                outputStream.close();
	            }
        	}
        }
Wäre nett, wenn mir jemand sagen könnte, warum die Bilder leer sind.

EDIT:
Code:
 DbxEntry.File downloadedFile = client.getFile("/Test/"+child.name, null,
	                    outputStream);
Musste ich anscheinend doch nochmal Ordnername angeben, dachte man ist schon in /Test also nicht nötig. ;7

lg
Warnuk3r is offline  
Old 05/12/2015, 09:31   #2
 
XxharCs's Avatar
 
elite*gold: 34
Join Date: Apr 2011
Posts: 1,475
Received Thanks: 1,228
Man muss den ganzen Pfad bis zur Datei angeben, da du vom root bzw. "/" startest und dich ggf. hinunter in Unterverzeichnisse durch iterierst.

Weil sonst sucht er zB in deinem Fall nach /TestDateiXYZ.jpg
Korrekt wie du schon im Edit draufgekommen bist wär /Test/DateiXYZ.jpg wobei die Datei in deinem Fall child.name ist
XxharCs is offline  
Reply


Similar Threads Similar Threads
[S] Dropbox Ref [b] 5eG
05/21/2014 - elite*gold Trading - 0 Replies
^ Meldet euch per PN. "PN me" oder sowas wird reported und ignoriert.
[B] 30 e*g [S] Dropbox Ref's
12/15/2013 - elite*gold Trading - 31 Replies
Hallo, Da ich gerne meine Dropbox mit mehr Speicher haben möchte, suche ich Refs, die sich über meinen Link bei Dropbox anmelden. Als ausgleich biete ich dafür 30 e*g pro Ref. Was muss ich tun? Ihr könnt euch auch gerne öfter anmelden. Jedoch merkt die Dropbox Anwendung ob ihr euche z.B. 5 mal von gleichen PC Reffed und zählt das iwann als ungültig. ~iTutHD
dropbox
09/07/2013 - Shaiya Private Server - 5 Replies
Hello I wonder if when our dropbox is opened The objects in the drop boxes you could it not be stacked one upon the other so that the opening is faster? Storage and also thank you : RTFM:



All times are GMT +2. The time now is 20:29.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.