Skip to content

Commit fdbc62b

Browse files
author
Karl Rieb
committed
2.0.4 release.
1 parent 49d6acf commit fdbc62b

File tree

553 files changed

+27653
-31394
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

553 files changed

+27653
-31394
lines changed

.gitignore

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
1+
# Gradle
2+
.gradle/
3+
build/
4+
15
# Maven build output folder
2-
/target
6+
/target/
37

48
# IntelliJ project folder
5-
/intellij
9+
intellij/
10+
.idea/
11+
*.iml
12+
local.properties
613

714
# Output file when rendering ReadMe.md locally.
815
/ReadMe.html

ChangeLog.txt

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,29 @@
1+
2.0.4 (2016-05-31)
2+
---------------------------------------------
3+
- Update to latest API specs:
4+
- Files (DbxUserFilesRequests)
5+
- Add saveUrl(..) saving online content to your Dropbox.
6+
- Shared folders (DbxUserSharingRequests)
7+
- Add AccessLevel.VIEWER_NO_COMMENT.
8+
- Add GroupInfo.getIsOwner().
9+
- Change return type of SharePathError.Tag.ALREADY_SHARED from Void to SharedFolderMetadata.
10+
- Add leaveACopy argument to relinquishFolderMembership(..).
11+
- Change relinquishFolderMembership(..) to return async job ID when leaving a copy.
12+
- Add JobError.Tag.RELINQUISH_FOLDER_MEMBERSHIP_ERROR.
13+
- Business endpoints (DbxTeamTeamRequests)
14+
- Add MemberProfiler.getMembershipType().
15+
- Add keepAccount argument to membersRemove(..).
16+
- Add CANNOT_KEEP_ACCOUNT_AND_TRANSFER and CANNOT_KEEP_ACCOUNT_AND_DELETE_DATA to MembersRemoveError.
17+
- Migrate build from maven to gradle.
18+
- Improve code shrinking when using ProGuard.
19+
- Response/request serialization updated to be better optimized by ProGuard.
20+
- Properly support multidex builds.
21+
- Response/request objects should no longer always be kept in primary dex.
22+
- Add partial download support through range requests.
23+
- Fix deserialization bug when handling new server responses that were previously void.
24+
- Fix bug where user locale is ignored for APIv2 requests.
25+
- Fix bug where filenames containing line feeds were rejected as bad requests.
26+
127
---------------------------------------------
228
2.0.3 (2016-05-07)
329
- Fix Bad JSON error on ProGuard optimized APKs when deserializing error responses.

ReadMe.md

Lines changed: 17 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ If you're using Maven, then edit your project's "pom.xml" and add this to the `<
1414
<dependency>
1515
<groupId>com.dropbox.core</groupId>
1616
<artifactId>dropbox-core-sdk</artifactId>
17-
<version>2.0.3</version>
17+
<version>2.0.4</version>
1818
</dependency>
1919
```
2020

@@ -23,10 +23,12 @@ If you are using Gradle, then edit your project's "build.gradle" and add this to
2323
```groovy
2424
dependencies {
2525
// ...
26-
compile 'com.dropbox.core:dropbox-core-sdk:2.0.3'
26+
compile 'com.dropbox.core:dropbox-core-sdk:2.0.4'
2727
}
2828
```
2929

30+
You can also download the Java SDK JAR and and its dependencies directly from the [latest release page](https://github.com/dropbox/dropbox-sdk-java/releases/latest).
31+
3032
## Get a Dropbox API key
3133

3234
You need a Dropbox API key to make API requests.
@@ -46,23 +48,21 @@ Save the API key to a JSON file called, say, "test.app":
4648
## Using the Dropbox API
4749

4850
Before your app can access a Dropbox user's files, the user must authorize your application using OAuth 2. Successfully completing this authorization flow gives you an _access token_ for the user's Dropbox account, which grants you the ability to make Dropbox API calls to access their files.
49-
* Example for a simple web app: [Web File Browser example](examples/web-file-browser/src/com/dropbox/core/examples/web_file_browser/DropboxAuth.java)
51+
* Example for a simple web app: [Web File Browser example](examples/web-file-browser/src/main/java/com/dropbox/core/examples/web_file_browser/DropboxAuth.java)
5052
* Example for an Android app: [Android example](examples/android/src/main/java/com/dropbox/core/examples/android/UserActivity.java)
51-
* Example for a command-line tool: [Command-Line Authorization example](examples/authorize/src/com/dropbox/core/examples/authorize/Main.java)
53+
* Example for a command-line tool: [Command-Line Authorization example](examples/authorize/src/main/java/com/dropbox/core/examples/authorize/Main.java)
5254

5355
Once you have an access token, create a [`DbxClientV2`](https://dropbox.github.io/dropbox-sdk-java/api-docs/v2.0.x/com/dropbox/core/v2/DbxClientV2.html) and start making API calls.
5456

5557
You only need to perform the authorization process once per user. Once you have an access token for a user, save it somewhere persistent, like in a database. The next time that user visits your app's, you can skip the authorization process and go straight to creating a `DbxClientV2` and making API calls.
5658

5759
## Running the examples
5860

59-
Prerequisites: Apache Maven
60-
6161
1. Download this repository.
6262
2. Save your Dropbox API key in a file called "test.app". See: [Get a Dropbox API key](#get-a-dropbox-api-key), above.
63-
3. `mvn install`
64-
4. To compile all the examples: `mvn -f examples/pom.xml compile`
65-
5. To compile just one example: `mvn -f examples/<example-name>/pom.xml compile`.
63+
3. Compile and install the SDK into your local maven repo: `./gradlew install`
64+
4. To compile all the examples: `(cd examples/ && ./gradlew classes`
65+
5. To compile just one example: `(cd examples/ && ./gradlew :<example-name>:classes`
6666

6767
### authorize
6868

@@ -126,23 +126,12 @@ cd examples
126126
## Running the integration tests
127127

128128
1. Run through the `authorize` example above to get a "test.auth" file.
129-
2. `./run-integration-tests <path-to-test.auth>`
130-
131-
Run `./run-integration-tests` with no arguments to see how to run individual tests.
129+
2. `./gradlew -Pcom.dropbox.test.authInfoFile=<path-to-test.auth> integrationTest`
132130

133-
## Loading the project in IntelliJ 14
134-
135-
Assume "{sdk}" represents the top-level folder of this SDK.
136-
137-
1. Click *Import Project*, select "{sdk}/pom.xml".
138-
2. You'll see the *Import Project From Maven* dialog.
139-
- Check *Search for projects recursively*
140-
- Check *Keep project files in*, set it to "{sdk}/intellij"
141-
- Check *Import Maven projects automatically*
142-
- Uncheck *Use Maven output directories*
143-
- Click *Next*
144-
3. Clicking *Next* on the rest of the dialogs.
145-
4. On the last dialog, you can change *Project name* if you want **but make sure** you set *Project file location* back to "{sdk}/intellij".
131+
To run individual tests, use the `--tests` gradle test filter:
132+
```
133+
./gradlew -Pcom.dropbox.test.authInfoFile=<path-to-test.auth> integrationTest --tests '*.DbxClientV1IT.testAccountInfo'
134+
```
146135

147136
## FAQ
148137

@@ -159,8 +148,8 @@ OSGi containers running on Java 1.6 or above should provide this capability. Un
159148
As a workaround, you can build your own version of the JAR that omits the "osgi.ee" capability by running:
160149

161150
```
162-
mvn clean
163-
mvn package -Dosgi.bnd.noee=true
151+
./gradlew clean
152+
./gradlew -Posgi.bnd.noee=true jar
164153
```
165154

166155
(This is equivalent to passing the "-noee" option to the OSGi "bnd" tool.)
@@ -169,19 +158,6 @@ Another workaround is to tell your OSGi container to provide that requirement: [
169158

170159
### Does this SDK require any special ProGuard rules for shrink optimizations?
171160

172-
Yes. This SDK uses Jackson JSON libraries for serialization. Specifically:
173-
174-
* [Jackson Core](https://github.com/FasterXML/jackson-core)
175-
* [Jackson Annotations](https://github.com/FasterXML/jackson-annotations)
176-
* [Jackson Databind](https://github.com/FasterXML/jackson-databind)
177-
178-
Jackson Databind makes use of reflection and annotations to map Java objects to JSON. Your ProGuard configuration should ensure Jackson annotations and Object mapping classes are kept. An example configuration is shown below:
179-
180-
```
181-
-keepattributes *Annotation*,EnclosingMethod,InnerClasses,Signature
182-
-keepnames class com.fasterxml.jackson.** { *; }
183-
-dontwarn com.fasterxml.jackson.databind.**
184-
-adaptresourcefilenames com/dropbox/core/http/trusted-certs.raw
185-
```
161+
Versions 2.0.0-2.0.3 of this SDK require specific ProGuard rules to work with shrinking enabled. However, since version **2.0.4**, the SDK no longer needs special ProGuard directives.
186162

187163
**IMPORTANT: If you are running version 2.0.x before 2.0.3, you should update to the latest Dropbox SDK version to avoid a deserialization bug that can cause Android apps that use ProGuard to crash.**

0 commit comments

Comments
 (0)