File tree Expand file tree Collapse file tree
examples/tutorial/src/main/java/com/dropbox/core/examples/tutorial Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11package com .dropbox .core .examples .tutorial ;
22
3+ import com .dropbox .core .DbxDownloader ;
34import com .dropbox .core .DbxException ;
45import com .dropbox .core .DbxRequestConfig ;
56import com .dropbox .core .v2 .callbacks .DbxGlobalCallbackFactory ;
1415import java .util .List ;
1516
1617import java .io .FileInputStream ;
18+ import java .io .FileOutputStream ;
1719import java .io .InputStream ;
1820import java .io .IOException ;
1921
@@ -48,5 +50,14 @@ public static void main(String args[]) throws DbxException, IOException {
4850 FileMetadata metadata = client .files ().uploadBuilder ("/test.txt" )
4951 .uploadAndFinish (in );
5052 }
53+
54+ DbxDownloader <FileMetadata > downloader = client .files ().download ("/test.txt" );
55+ try {
56+ FileOutputStream out = new FileOutputStream ("test.txt" );
57+ downloader .download (out );
58+ out .close ();
59+ } catch (DbxException ex ) {
60+ System .out .println (ex .getMessage ());
61+ }
5162 }
5263}
You can’t perform that action at this time.
0 commit comments