Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite7a6960

Browse files
committed
Add download example to tutorial.
1 parent0aac92b commite7a6960

File tree

1 file changed

+11
-0
lines changed
  • examples/tutorial/src/main/java/com/dropbox/core/examples/tutorial

1 file changed

+11
-0
lines changed

‎examples/tutorial/src/main/java/com/dropbox/core/examples/tutorial/Main.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
packagecom.dropbox.core.examples.tutorial;
22

3+
importcom.dropbox.core.DbxDownloader;
34
importcom.dropbox.core.DbxException;
45
importcom.dropbox.core.DbxRequestConfig;
56
importcom.dropbox.core.v2.callbacks.DbxGlobalCallbackFactory;
@@ -14,6 +15,7 @@
1415
importjava.util.List;
1516

1617
importjava.io.FileInputStream;
18+
importjava.io.FileOutputStream;
1719
importjava.io.InputStream;
1820
importjava.io.IOException;
1921

@@ -48,5 +50,14 @@ public static void main(String args[]) throws DbxException, IOException {
4850
FileMetadatametadata =client.files().uploadBuilder("/test.txt")
4951
.uploadAndFinish(in);
5052
}
53+
54+
DbxDownloader<FileMetadata>downloader =client.files().download("/test.txt");
55+
try {
56+
FileOutputStreamout =newFileOutputStream("test.txt");
57+
downloader.download(out);
58+
out.close();
59+
}catch (DbxExceptionex) {
60+
System.out.println(ex.getMessage());
61+
}
5162
}
5263
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp