-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
UPDATE: update jackson(to 2.8.5), netty(to 5.0-alpha) library
- Loading branch information
Showing
95 changed files
with
477 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
group 'org.onedrive' | ||
version '0.9-beta' | ||
|
||
apply plugin: 'java' | ||
apply plugin: 'idea' | ||
|
||
sourceCompatibility = 1.7 | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
compile 'com.fasterxml.jackson.core:jackson-annotations:2.8.5+' | ||
compile 'com.fasterxml.jackson.core:jackson-core:2.8.5+' | ||
compile 'com.fasterxml.jackson.core:jackson-databind:2.8.5+' | ||
|
||
compile 'com.fasterxml.jackson.module:jackson-module-afterburner:2.8.5+' | ||
|
||
compile 'io.netty:netty-buffer:5.0.0.Alpha2+' | ||
compile 'io.netty:netty-codec:5.0.0.Alpha2+' | ||
compile 'io.netty:netty-codec-http:5.0.0.Alpha2+' | ||
compile 'io.netty:netty-common:5.0.0.Alpha2+' | ||
compile 'io.netty:netty-handler:5.0.0.Alpha2+' | ||
compile 'io.netty:netty-resolver:5.0.0.Alpha2+' | ||
compile 'io.netty:netty-transport:5.0.0.Alpha2+' | ||
|
||
compile 'org.projectlombok:lombok:1.16.12+' | ||
|
||
compile 'org.jetbrains:annotations:15.0+' | ||
|
||
testCompile group: 'junit', name: 'junit', version: '4.11+' | ||
} |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
rootProject.name = 'onedrive-sdk-java' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -94,6 +94,7 @@ public class Client { | |
* @param redirectURL Redirect URL that programmer already set in Application setting. It must matches with set | ||
* one! | ||
* @param clientSecret Client secret key that MS gave to programmer. | ||
* | ||
* @throws InternalException If fail to create {@link URI} object in auth process. | ||
* if it happens it's probably bug, so please report to | ||
* <a href="mailto:[email protected]" target="_top">author</a>. | ||
|
@@ -115,6 +116,7 @@ public Client(@NotNull String clientId, @NotNull String[] scope, | |
* one! | ||
* @param clientSecret Client secret key that MS gave to programmer. | ||
* @param autoLogin if {@code true} construct with auto login. | ||
* | ||
* @throws InternalException If fail to create {@link URI} object in auth process. | ||
* if it happens it's probably bug, so please report to | ||
* <a href="mailto:[email protected]" target="_top">author</a>. | ||
|
@@ -202,6 +204,7 @@ public void login() { | |
* {@link Client#Client(String, String[], String, String)}.) | ||
* | ||
* @return <b>Access Code</b>({@code this.accessToken}) if successful. Otherwise throw {@link RuntimeException}. | ||
* | ||
* @throws InternalException If fail to create {@link URI} object in auth process. | ||
* if it happens it's probably bug, so please report to | ||
* <a href="mailto:[email protected]" target="_top">author</a>. | ||
|
@@ -262,6 +265,7 @@ private String getCode() { | |
* <a href="https://dev.onedrive.com/auth/msa_oauth.htm#step-3-get-a-new-access-token-or-refresh-token">detail</a> | ||
* | ||
* @return access token {@code String} that given from server. | ||
* | ||
* @throws InvalidJsonException If fail to parse response of login request into json, or even if success to parse, | ||
* if there're unexpected value. both caused by server side not by SDK. | ||
* @throws InternalException if the underlying input source has problems during parsing response body. | ||
|
@@ -278,13 +282,14 @@ private String redeemToken() { | |
* <a href="https://dev.onedrive.com/auth/msa_oauth.htm#step-3-get-a-new-access-token-or-refresh-token">detail</a> | ||
* | ||
* @return refreshed access token {@code String}. | ||
* | ||
* @throws IllegalStateException If caller {@code Client} object isn't login yet. | ||
* @throws InvalidJsonException If fail to parse response of login request into json, or even if success to parse, | ||
* if there're unexpected value. both caused by server side not by SDK. | ||
* @throws InternalException if the underlying input source has problems during parsing response body. | ||
*/ | ||
@NotNull | ||
public String refreshToken() { | ||
public String refreshLogin() { | ||
if (!isLogin()) throw LOGIN_FIRST; | ||
|
||
return getToken( | ||
|
@@ -298,7 +303,9 @@ public String refreshToken() { | |
* {@code Client} object. | ||
* | ||
* @param httpBody HTTP POST's body that will be sent to server for being granted. | ||
* | ||
* @return access token {@code String} that given from server. | ||
* | ||
* @throws InvalidJsonException If fail to parse response of login request into json, or even if success to parse, | ||
* if there're unexpected value. both caused by server side not by SDK. | ||
* @throws InternalException if the underlying input source has problems during parsing response body. | ||
|
@@ -361,7 +368,7 @@ private void saveToken(String accessToken, String refreshToken, String userId, S | |
} | ||
|
||
/** | ||
* Check expiration of authentication. if expired, refresh it with {@link Client#refreshToken()}. | ||
* Check expiration of authentication. if expired, refresh it with {@link Client#refreshLogin()}. | ||
* | ||
* @throws IllegalStateException If caller {@code Client} object isn't login yet. | ||
* @throws InvalidJsonException If fail to parse response of login request into json, or even if success to parse, | ||
|
@@ -371,7 +378,7 @@ private void saveToken(String accessToken, String refreshToken, String userId, S | |
private void checkExpired() { | ||
if (!isLogin()) throw LOGIN_FIRST; | ||
|
||
if (isExpired()) refreshToken(); | ||
if (isExpired()) refreshLogin(); | ||
} | ||
|
||
|
||
|
@@ -458,6 +465,7 @@ public FolderItem getRootDir() throws ErrorResponseException { | |
* {@// TODO: handling error if `id`'s item isn't folder item. } | ||
* | ||
* @param id folder's id. | ||
* | ||
* @return folder object | ||
*/ | ||
@NotNull | ||
|
@@ -517,6 +525,7 @@ public FolderItem getFolder(@NotNull BasePointer pointer, boolean childrenFetchi | |
* {@// TODO: Enhance javadoc } | ||
* | ||
* @param id file id. | ||
* | ||
* @return file object | ||
*/ | ||
@NotNull | ||
|
@@ -633,7 +642,9 @@ public BaseItem[] getShared() throws ErrorResponseException { | |
* | ||
* @param srcId item's id that wants to be copied | ||
* @param destId location's id that wants to be placed the copied item | ||
* | ||
* @return URL {@code String} that can monitor status of copying process | ||
* | ||
* @throws ErrorResponseException if error happens while requesting copying operation. such as invalid copying | ||
* request | ||
* @throws InvalidJsonException if fail to parse response of copying request into json. it caused by server side | ||
|
@@ -649,6 +660,7 @@ public String copyItem(@NotNull String srcId, @NotNull String destId) throws Err | |
* Works just like {@link Client#copyItem(String, String)}} except new name of item can be designated. | ||
* | ||
* @param newName new name of item that will be copied | ||
* | ||
* @see Client#copyItem(String, String) | ||
*/ | ||
@NotNull | ||
|
@@ -702,8 +714,10 @@ public String copyItem(@NotNull BasePointer src, @NotNull BasePointer dest, @Not | |
* @param api OneDrive copying api that contains item's location. Note that it must be ensured that | ||
* {@code api} is a escaped {@code String} | ||
* @param content HTTP body | ||
* | ||
* @return URL {@code String} that can monitor status of copying process | ||
* {@// TODO: end of copying process, is this link will be useless or inaccessible ? } | ||
* | ||
* @throws ErrorResponseException if error happens while requesting copying operation. such as invalid copying | ||
* request | ||
* @throws InvalidJsonException if fail to parse response of copying request into json. it caused by server side | ||
|
@@ -804,7 +818,9 @@ private BaseItem moveItem(@NotNull String api, @NotNull byte[] content) throws E | |
* | ||
* @param parentId Parent ID that creating folder inside. | ||
* @param name New folder name. | ||
* | ||
* @return New folder's object. | ||
* | ||
* @throws RuntimeException If creating folder or converting response is fails. | ||
*/ | ||
@NotNull | ||
|
@@ -821,7 +837,9 @@ public FolderItem createFolder(@NotNull String parentId, @NotNull String name) t | |
* | ||
* @param parent Parent pointer that creating folder inside. (either ID or path) | ||
* @param name New folder name. | ||
* | ||
* @return New folder's object. | ||
* | ||
* @throws RuntimeException If creating folder or converting response is fails. | ||
*/ | ||
@NotNull | ||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.