Skip to content

Commit

Permalink
2.0.2 release.
Browse files Browse the repository at this point in the history
  • Loading branch information
Karl Rieb committed Apr 28, 2016
1 parent 3cfa878 commit 8594e8f
Show file tree
Hide file tree
Showing 115 changed files with 10,434 additions and 579 deletions.
27 changes: 27 additions & 0 deletions ChangeLog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,30 @@
---------------------------------------------
2.0.2 (2016-04-28)
- Update to latest API specs:
- Authentication
- Add token/revoke endpoint.
- Account
- Add disabled field to Account.
- Files (DbxUserFilesRequests)
- Add withIncludeDeleted(Boolean) and withIncludeHasExplicitSharedMembers(Boolean) to GetMetadataBuilder and ListFolderBuilder.
- Add close argument to uploadSessionStart(..) to explicitly close an upload session.
- Add uploadSessionAppendV2(..) that provides explicit session close support. uploadSessionAppend(..) is now deprecated.
- Add copyReferenceGet(..) and copyReferenceSave(..) for copying files and folders.
- Add getTemporaryLink(..) endpoint.
- Shared links (DbxUserSharingRequests)
- Add removeExpiration argument to modifySharedLinkSettings(..).
- Shared folders
- Add FolderAction.LEAVE_A_COPY.
- Add SharedFolderMetadata.getTimeInvited().
- Add IS_OSX_PACKAGE and INSIDE_OSX_PACKAGE to SharePathError. Returned when a user attempts to share an OS X package or folder inside an OS X package.
- Business endpoints (DbxTeamTeamRequests)
- GroupSummary.getMemberCount() is now optional and returns a Long.
- devicesListTeamDevices(..) is now deprecated by devicesListMemberDevices(..).
- linkedAppsListTeamLinkedApps(..) is now deprecated by linkedAppsListMembersLinkedApps(..).
- Add returnMembers argument to groupsMembersSetAccessType(..).
- Fix JsonDateReaderTest failures for non-English systems.
- Update ProGuard rules to fix handling of embedded trusted SSL certs resource.
- Fix tutorial example to list folder entries for folders with many files.

---------------------------------------------
2.0.1 (2016-03-09)
Expand Down
5 changes: 3 additions & 2 deletions ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ If you're using Maven, then edit your project's "pom.xml" and add this to the `<
<dependency>
<groupId>com.dropbox.core</groupId>
<artifactId>dropbox-core-sdk</artifactId>
<version>2.0.1</version>
<version>2.0.2</version>
</dependency>
```

Expand All @@ -23,7 +23,7 @@ If you are using Gradle, then edit your project's "build.gradle" and add this to
```groovy
dependencies {
// ...
compile 'com.dropbox.core:dropbox-core-sdk:2.0.1'
compile 'com.dropbox.core:dropbox-core-sdk:2.0.2'
}
```

Expand Down Expand Up @@ -181,4 +181,5 @@ Jackson Databind makes use of reflection and annotations to map Java objects to
-keepattributes *Annotation*,EnclosingMethod,InnerClasses,Signature
-keepnames class com.fasterxml.jackson.** { *; }
-dontwarn com.fasterxml.jackson.databind.**
-adaptresourcefilenames com/dropbox/core/http/trusted-certs.raw
```
2 changes: 1 addition & 1 deletion examples/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'
classpath 'com.android.tools.build:gradle:2.1.0'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
4 changes: 2 additions & 2 deletions examples/android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Wed Apr 10 15:27:10 PDT 2013
#Wed Apr 27 11:21:25 PDT 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip
5 changes: 5 additions & 0 deletions examples/android/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,12 @@
-keepnames class com.fasterxml.jackson.** { *; }
-dontwarn com.fasterxml.jackson.databind.**

# Dropbox SSL trusted certs

-adaptresourcefilenames com/dropbox/core/http/trusted-certs.raw

# OkHttp and Servlet optional dependencies

-dontwarn okio.**
-dontwarn javax.servlet.**

Expand Down
1 change: 1 addition & 0 deletions examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
<source>8</source>
<target>8</target>
<encoding>UTF-8</encoding>
<showDeprecation>true</showDeprecation>
</configuration>
</plugin>
</plugins>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.dropbox.core.DbxRequestConfig;
import com.dropbox.core.v2.DbxClientV2;
import com.dropbox.core.v2.files.FileMetadata;
import com.dropbox.core.v2.files.ListFolderResult;
import com.dropbox.core.v2.files.Metadata;
import com.dropbox.core.v2.users.FullAccount;

Expand All @@ -26,9 +27,17 @@ public static void main(String args[]) throws DbxException, IOException {
System.out.println(account.getName().getDisplayName());

// Get files and folder metadata from Dropbox root directory
List<Metadata> entries = client.files().listFolder("").getEntries();
for (Metadata metadata : entries) {
System.out.println(metadata.getPathLower());
ListFolderResult result = client.files().listFolder("");
while (true) {
for (Metadata metadata : result.getEntries()) {
System.out.println(metadata.getPathLower());
}

if (!result.getHasMore()) {
break;
}

result = client.files().listFolderContinue(result.getCursor());
}

// Upload "test.txt" to Dropbox
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,17 +116,19 @@ private static void chunkedUploadFile(DbxClientV2 dbxClient, File localFile, Str
printProgress(uploaded, size);
}

UploadSessionCursor cursor = new UploadSessionCursor(sessionId, uploaded);

// (2) Append
while ((size - uploaded) > CHUNKED_UPLOAD_CHUNK_SIZE) {
dbxClient.files().uploadSessionAppend(sessionId, uploaded)
dbxClient.files().uploadSessionAppendV2(cursor)
.uploadAndFinish(in, CHUNKED_UPLOAD_CHUNK_SIZE);
uploaded += CHUNKED_UPLOAD_CHUNK_SIZE;
printProgress(uploaded, size);
cursor = new UploadSessionCursor(sessionId, uploaded);
}

// (3) Finish
long remaining = size - uploaded;
UploadSessionCursor cursor = new UploadSessionCursor(sessionId, uploaded);
CommitInfo commitInfo = CommitInfo.newBuilder(dropboxPath)
.withMode(WriteMode.ADD)
.withClientModified(new Date(localFile.lastModified()))
Expand Down
12 changes: 9 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,15 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.caliper</groupId>
<artifactId>caliper</artifactId>
<version>1.0-beta-2</version>
<groupId>org.openjdk.jmh</groupId>
<artifactId>jmh-core</artifactId>
<version>1.11.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.openjdk.jmh</groupId>
<artifactId>jmh-generator-annprocess</artifactId>
<version>1.11.3</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
2 changes: 1 addition & 1 deletion run-bench
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ classpath_file="$build_dir/test-classpath"

classpath="$build_dir/classes:$build_dir/test-classes"
classpath="$classpath:$(cat "$classpath_file")"
exec java -cp "$classpath" com.dropbox.core.CaliperMainRelay "$@"
exec java -cp "$classpath" org.openjdk.jmh.Main "$@"
12 changes: 12 additions & 0 deletions src/main/java/com/dropbox/core/v2/DbxClientV2Base.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

package com.dropbox.core.v2;

import com.dropbox.core.v2.auth.DbxUserAuthRequests;
import com.dropbox.core.v2.files.DbxUserFilesRequests;
import com.dropbox.core.v2.sharing.DbxUserSharingRequests;
import com.dropbox.core.v2.users.DbxUserUsersRequests;
Expand All @@ -13,6 +14,7 @@
public class DbxClientV2Base {
protected final DbxRawClientV2 _client;

private final DbxUserAuthRequests auth;
private final DbxUserFilesRequests files;
private final DbxUserSharingRequests sharing;
private final DbxUserUsersRequests users;
Expand All @@ -24,11 +26,21 @@ public class DbxClientV2Base {
*/
protected DbxClientV2Base(DbxRawClientV2 _client) {
this._client = _client;
this.auth = new DbxUserAuthRequests(_client);
this.files = new DbxUserFilesRequests(_client);
this.sharing = new DbxUserSharingRequests(_client);
this.users = new DbxUserUsersRequests(_client);
}

/**
* Returns client for issuing requests in the {@code "auth"} namespace.
*
* @return Dropbox auth client
*/
public DbxUserAuthRequests auth() {
return auth;
}

/**
* Returns client for issuing requests in the {@code "files"} namespace.
*
Expand Down
51 changes: 51 additions & 0 deletions src/main/java/com/dropbox/core/v2/auth/DbxUserAuthRequests.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/* DO NOT EDIT */
/* This file was generated from auth.babel */

package com.dropbox.core.v2.auth;

import com.dropbox.core.DbxApiException;
import com.dropbox.core.DbxException;
import com.dropbox.core.DbxRequestUtil;
import com.dropbox.core.http.HttpRequestor;
import com.dropbox.core.json.JsonUtil;
import com.dropbox.core.v2.DbxRawClientV2;

import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.JavaType;

import java.util.HashMap;
import java.util.Map;

/**
* Routes in namespace "auth" that support user auth.
*/
public final class DbxUserAuthRequests {
// namespace auth

private final DbxRawClientV2 client;

public DbxUserAuthRequests(DbxRawClientV2 client) {
this.client = client;
}

//
// route auth/token/revoke
//

/**
* Disables the access token used to authenticate the call.
*/
public void tokenRevoke() throws DbxException {
try {
client.rpcStyle(client.getHost().getApi(),
"2/auth/token/revoke",
null,
false,
JsonUtil.createType(Void.class),
JsonUtil.createType(Void.class));
}
catch (DbxRequestUtil.ErrorWrapper ew) {
throw new DbxApiException(ew.getRequestId(), ew.getUserMessage(), "Unexpected error response for \"token/revoke\": ew.errValue");
}
}
}
3 changes: 2 additions & 1 deletion src/main/java/com/dropbox/core/v2/auth/package-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/* This file was generated from auth.babel */

/**
* See None for a list of possible requests for this namespace.
* See {@link com.dropbox.core.v2.auth.DbxUserAuthRequests} for a list of
* possible requests for this namespace.
*/
package com.dropbox.core.v2.auth;
48 changes: 26 additions & 22 deletions src/main/java/com/dropbox/core/v2/files/CommitInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,12 @@ public class CommitInfo {
* @param path Path in the user's Dropbox to save the file. Must match
* pattern "{@code /.*}" and not be {@code null}.
* @param mode Selects what to do if the file already exists.
* @param autorename If there's a conflict, as determined by {@link
* CommitInfo#getMode}, have the Dropbox server try to autorename the
* file to avoid conflict.
* @param clientModified The value to store as the {@link
* CommitInfo#getClientModified} timestamp. Dropbox automatically
* @param autorename If there's a conflict, as determined by the {@code
* mode} argument to {@link DbxUserFilesRequests#upload(String)}, have
* the Dropbox server try to autorename the file to avoid conflict.
* @param clientModified The value to store as the the {@code
* clientModified} argument to {@link
* DbxUserFilesRequests#upload(String)} timestamp. Dropbox automatically
* records the time at which the file was written to the Dropbox
* servers. It can also record an additional timestamp, provided by
* Dropbox desktop clients, mobile clients, and API apps of when the
Expand Down Expand Up @@ -115,8 +116,9 @@ public WriteMode getMode() {
}

/**
* If there's a conflict, as determined by {@link CommitInfo#getMode}, have
* the Dropbox server try to autorename the file to avoid conflict.
* If there's a conflict, as determined by the {@code mode} argument to
* {@link DbxUserFilesRequests#upload(String)}, have the Dropbox server try
* to autorename the file to avoid conflict.
*
* @return value for this field, or {@code null} if not present. Defaults to
* false.
Expand All @@ -126,11 +128,12 @@ public boolean getAutorename() {
}

/**
* The value to store as the {@link CommitInfo#getClientModified} timestamp.
* Dropbox automatically records the time at which the file was written to
* the Dropbox servers. It can also record an additional timestamp, provided
* by Dropbox desktop clients, mobile clients, and API apps of when the file
* was actually created or modified.
* The value to store as the the {@code clientModified} argument to {@link
* DbxUserFilesRequests#upload(String)} timestamp. Dropbox automatically
* records the time at which the file was written to the Dropbox servers. It
* can also record an additional timestamp, provided by Dropbox desktop
* clients, mobile clients, and API apps of when the file was actually
* created or modified.
*
* @return value for this field, or {@code null} if not present.
*/
Expand Down Expand Up @@ -218,10 +221,10 @@ public Builder withMode(WriteMode mode) {
* <p> If left unset or set to {@code null}, defaults to {@code false}.
* </p>
*
* @param autorename If there's a conflict, as determined by {@link
* CommitInfo#getMode}, have the Dropbox server try to autorename
* the file to avoid conflict. Defaults to {@code false} when set to
* {@code null}.
* @param autorename If there's a conflict, as determined by the {@code
* mode} argument to {@link DbxUserFilesRequests#upload(String)},
* have the Dropbox server try to autorename the file to avoid
* conflict. Defaults to {@code false} when set to {@code null}.
*
* @return this builder
*/
Expand All @@ -238,12 +241,13 @@ public Builder withAutorename(Boolean autorename) {
/**
* Set value for optional field.
*
* @param clientModified The value to store as the {@link
* CommitInfo#getClientModified} timestamp. Dropbox automatically
* records the time at which the file was written to the Dropbox
* servers. It can also record an additional timestamp, provided by
* Dropbox desktop clients, mobile clients, and API apps of when the
* file was actually created or modified.
* @param clientModified The value to store as the the {@code
* clientModified} argument to {@link
* DbxUserFilesRequests#upload(String)} timestamp. Dropbox
* automatically records the time at which the file was written to
* the Dropbox servers. It can also record an additional timestamp,
* provided by Dropbox desktop clients, mobile clients, and API apps
* of when the file was actually created or modified.
*
* @return this builder
*/
Expand Down
Loading

0 comments on commit 8594e8f

Please sign in to comment.