Skip to content

Commit a24122f

Browse files
author
Caitlin Bales (MSFT)
authored
Merge pull request #75 from microsoftgraph/dev
March Updates
2 parents 6ffa209 + e8b0168 commit a24122f

File tree

4,134 files changed

+228301
-429
lines changed

Some content is hidden

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

4,134 files changed

+228301
-429
lines changed

.github/ISSUE_TEMPLATE.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,12 @@ Before you open this issue, did you:
1414
- Review the samples under github.com/microsoftgraph? They can help for some scenarios.
1515
- Take a look at the functional tests in this repo? They may have an example for you. See the [functional tests](https://github.com/microsoftgraph/msgraph-sdk-java/tree/master/src/test/java/com/microsoft/graph/functional)
1616
17+
Please provide the following before submitting this issue:
18+
- Expected behavior. Please provide **links to the specific [Microsoft Graph documentation](https://developer.microsoft.com/en-us/graph/docs/concepts/overview)** you used to determine the expected behavior.
19+
- Actual behavior. Provide error codes, stack information, and a [Fiddler](http://www.telerik.com/fiddler) capture of the request and response (please remove personally identifiable information before posting).
20+
- Steps to reproduce the behavior. Include your code, IDE versions, client library versions, and any other information that might be helpful to understand your scenario.
1721
-->
1822

19-
Please provide the following (and please check them off the list with [x]) before submitting this issue:
20-
- [ ] Expected behavior. Please provide **links to the specific [Microsoft Graph documentation](https://developer.microsoft.com/en-us/graph/docs/concepts/overview)** you used to determine the expected behavior.
21-
- [ ] Actual behavior. Provide error codes, stack information, and a [Fiddler](http://www.telerik.com/fiddler) capture of the request and response (please remove personally identifiable information before posting).
22-
- [ ] Steps to reproduce the behavior. Include your code, IDE versions, client library versions, and any other information that might be helpful to understand your scenario.
23-
2423
### Expected behavior
2524

2625

README.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,22 @@
11
# Preview Microsoft Graph SDK for Java
22
*This SDK is currently in preview. Please continue to provide [feedback](https://github.com/microsoftgraph/msgraph-sdk-java/issues/new) as we iterate towards a production-supported library.*
33

4+
[ ![Download](https://api.bintray.com/packages/microsoftgraph/Maven/microsoft-graph/images/download.svg) ](https://bintray.com/microsoftgraph/Maven/microsoft-graph/_latestVersion)
5+
6+
47
Get started with the Microsoft Graph SDK for Java by integrating the [Microsoft Graph API](https://graph.microsoft.io/en-us/getting-started) into your Java application!
58

69
## 1. Installation
710

811
### 1.1 Install via Gradle
9-
Add the JCenter repository and a compile dependency for `microsoft-graph` to your project's `build.gradle`:
12+
13+
Add the repository and a compile dependency for `microsoft-graph` to your project's `build.gradle`:
1014

1115
```gradle
1216
repository {
13-
jcenter()
17+
jcenter {
18+
url "https://dl.bintray.com/microsoftgraph/Maven"
19+
}
1420
}
1521
1622
dependency {
@@ -38,12 +44,10 @@ For an example of authentication in a client application, see the [MSGraph SDK A
3844
After you have set the correct application ID and URL, you must get a **GraphServiceClient** object to make requests against the service. The SDK stores the account information for you, but when a user signs in for the first time, it invokes the UI to get the user's account information.
3945

4046
```java
41-
IClientConfig clientConfig =
42-
DefaultClientConfig.createWithAuthenticationProvider(mAuthenticationProvider);
43-
4447
IGraphServiceClient graphClient =
45-
GraphServiceClient.builder()
46-
.fromConfig(mClientConfig)
48+
GraphServiceClient
49+
.builder()
50+
.authenticationProvider(authenticationProvider)
4751
.buildClient();
4852
```
4953

build.gradle

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
/*
1+
-/*
22
* This build file was generated by the Gradle 'init' task.
33
*
44
* This generated file contains a sample Java Library project to get you started.
55
* For more details take a look at the Java Libraries chapter in the Gradle
6-
* user guide available at https://docs.gradle.org/3.5/userguide/java_library_plugin.html
6+
* user guide available at https://docs.gradle.org/4.5/userguide/java_library_plugin.html
77
*/
88

99
// Apply the java-library plugin to add support for Java Library
@@ -25,7 +25,7 @@ dependencies {
2525
api 'org.apache.commons:commons-math3:3.6.1'
2626

2727
// This dependency is used internally, and not exposed to consumers on their own compile classpath.
28-
implementation 'com.google.guava:guava:21.0'
28+
implementation 'com.google.guava:guava:20.0'
2929

3030
// Use JUnit test framework
3131
testImplementation 'junit:junit:4.12'
@@ -35,25 +35,39 @@ dependencies {
3535
compile 'com.sun.jersey:jersey-server:1.19.4'
3636
}
3737

38+
3839
publishing {
40+
3941
publications {
42+
4043
maven(MavenPublication) {
44+
4145
groupId 'com.microsoft.graph'
46+
4247
artifactId 'microsoft-graph'
43-
version '0.1-SNAPSHOT'
48+
49+
version '${mavenMajorVersion}.${mavenMinorVersion}-SNAPSHOT'
4450

4551
from components.java
46-
52+
4753
artifact sourceJar
54+
4855
}
56+
4957
}
58+
5059
}
5160

5261
task sourceJar(type: Jar) {
5362
classifier = 'sources'
5463
from sourceSets.main.allJava
5564
}
5665

66+
compileJava {
67+
sourceCompatibility = 1.7
68+
targetCompatibility = 1.7
69+
}
70+
5771
def getVersionCode() {
5872
return mavenMajorVersion.toInteger() * 10000 + mavenMinorVersion.toInteger() * 100 + mavenPatchVersion.toInteger()
5973
}

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ mavenRepoUrl = https://api.bintray.com/maven/microsoftgraph/Maven/micros
2424
mavenGroupId = com.microsoft.graph
2525
mavenArtifactId = microsoft-graph
2626
mavenMajorVersion = 0
27-
mavenMinorVersion = 1
27+
mavenMinorVersion = 2
2828
mavenPatchVersion = 0
2929
nightliesUrl = http://dl.bintray.com/MicrosoftGraph/Maven
3030

gradlew

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,16 @@ APP_NAME="Gradle"
2828
APP_BASE_NAME=`basename "$0"`
2929

3030
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
31-
DEFAULT_JVM_OPTS=""
31+
DEFAULT_JVM_OPTS="-Xmx128m -Dfile.encoding=UTF-8"
3232

3333
# Use the maximum available, or set MAX_FD != -1 to use that value.
3434
MAX_FD="maximum"
3535

36-
warn ( ) {
36+
warn () {
3737
echo "$*"
3838
}
3939

40-
die ( ) {
40+
die () {
4141
echo
4242
echo "$*"
4343
echo
@@ -155,7 +155,7 @@ if $cygwin ; then
155155
fi
156156

157157
# Escape application args
158-
save ( ) {
158+
save () {
159159
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
160160
echo " "
161161
}

gradlew.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ set APP_BASE_NAME=%~n0
1414
set APP_HOME=%DIRNAME%
1515

1616
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17-
set DEFAULT_JVM_OPTS=
17+
set DEFAULT_JVM_OPTS=-Xmx128m -Dfile.encoding=UTF-8
1818

1919
@rem Find java.exe
2020
if defined JAVA_HOME goto findJavaFromJavaHome

src/main/java/com/microsoft/graph/concurrency/DefaultExecutors.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
package com.microsoft.graph.concurrency;
2424

2525
import com.microsoft.graph.logger.ILogger;
26+
import com.google.common.annotations.VisibleForTesting;
2627
import com.microsoft.graph.core.ClientException;
2728

2829
import java.util.concurrent.Executors;
@@ -139,4 +140,9 @@ public void run() {
139140
});
140141
}
141142

143+
@VisibleForTesting
144+
public ILogger getLogger() {
145+
return logger;
146+
}
147+
142148
}

src/main/java/com/microsoft/graph/core/Constants.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ private Constants() {
1212
public static final String APPID = "app-id";
1313
public static final String USERNAME = "[email protected]";
1414
public static final String PASSWORD = "password";
15-
public static final String VERSION_NAME = "0.1.0";
15+
public static final String VERSION_NAME = "0.2.0";
1616
}

src/main/java/com/microsoft/graph/core/DefaultClientConfig.java

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,6 @@
3737
*/
3838
public abstract class DefaultClientConfig implements IClientConfig {
3939

40-
/**
41-
* The authentication provider instance
42-
*/
43-
private IAuthenticationProvider authenticationProvider;
44-
4540
/**
4641
* The executors instance
4742
*/
@@ -72,8 +67,12 @@ public static IClientConfig createWithAuthenticationProvider(
7267
final IAuthenticationProvider authenticationProvider
7368
) {
7469
DefaultClientConfig config = new DefaultClientConfig() {
70+
71+
@Override
72+
public IAuthenticationProvider getAuthenticationProvider() {
73+
return authenticationProvider;
74+
}
7575
};
76-
config.authenticationProvider = authenticationProvider;
7776
config.getLogger()
7877
.logDebug(
7978
"Using provided auth provider "
@@ -90,10 +89,7 @@ public static IClientConfig createWithAuthenticationProvider(
9089
* @return the authentication provider
9190
*/
9291
@Override
93-
public IAuthenticationProvider getAuthenticationProvider() {
94-
return authenticationProvider;
95-
}
96-
92+
public abstract IAuthenticationProvider getAuthenticationProvider();
9793
/**
9894
* Gets the HTTP provider
9995
*

src/main/java/com/microsoft/graph/http/BaseRequest.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727

2828
import com.microsoft.graph.concurrency.ICallback;
2929
import com.microsoft.graph.core.IBaseClient;
30-
import com.microsoft.graph.core.GraphErrorCodes;
3130
import com.microsoft.graph.options.FunctionOption;
3231
import com.microsoft.graph.options.QueryOption;
3332
import com.microsoft.graph.core.ClientException;
@@ -90,7 +89,7 @@ public abstract class BaseRequest implements IHttpRequest {
9089
/**
9190
* The class for the response
9291
*/
93-
private final Class responseClass;
92+
private final Class<?> responseClass;
9493

9594
/**
9695
* Value to pass to setUseCaches in connection
@@ -258,7 +257,7 @@ protected <T1, T2> void send(final HttpMethod method,
258257
final ICallback<T1> callback,
259258
final T2 serializedObject) {
260259
this.method = method;
261-
client.getHttpProvider().send(this, callback, responseClass, serializedObject);
260+
client.getHttpProvider().send(this, callback, (Class<T1>) responseClass, serializedObject);
262261
}
263262

264263
/**
@@ -350,8 +349,7 @@ public IBaseClient getClient() {
350349
*
351350
* @return the response type
352351
*/
353-
@SuppressWarnings("unchecked")
354-
public Class getResponseType() {
352+
public Class<?> getResponseType() {
355353
return responseClass;
356354
}
357355
}

0 commit comments

Comments
 (0)