Skip to content

Commit b718a69

Browse files
committed
- updates common files with 2-3-0 releases from v1.0
1 parent 1f1c398 commit b718a69

23 files changed

+503
-337
lines changed

.github/dependabot.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,3 @@ updates:
55
schedule:
66
interval: daily
77
open-pull-requests-limit: 10
8-
- package-ecosystem: maven
9-
directory: "/"
10-
schedule:
11-
interval: daily
12-
open-pull-requests-limit: 10

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,4 @@ hs_err_pid*
3333
/target/
3434
/pom.xml
3535
local.properties
36+
.idea

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
{
2-
"java.configuration.updateBuildConfiguration": "automatic"
2+
"java.configuration.updateBuildConfiguration": "automatic",
3+
"git.ignoreLimitWarning": true
34
}

build.gradle

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ plugins {
1616
id 'com.jfrog.bintray' version '1.8.5'
1717
}
1818

19+
java {
20+
modularity.inferModulePath = true
21+
}
22+
1923
// In this section you declare where to find the dependencies of your project
2024
repositories {
2125
// Use jcenter for resolving your dependencies.
@@ -31,12 +35,12 @@ dependencies {
3135
// Use JUnit test framework
3236
testImplementation 'junit:junit:4.13'
3337

34-
implementation 'com.google.code.gson:gson:2.8.6'
38+
api 'com.google.code.gson:gson:2.8.6'
3539

3640
implementation 'com.squareup.okhttp3:okhttp:3.12.1'
3741

3842
// Core Http library
39-
implementation 'com.microsoft.graph:microsoft-graph-core:1.0.5'
43+
api 'com.microsoft.graph:microsoft-graph-core:1.0.5'
4044
}
4145

4246
def pomConfig = {
@@ -54,12 +58,20 @@ def pomConfig = {
5458
//Maven Central Release: publishMavenCentralReleasePublicationToMaven2Repository
5559
//Bintray Snapshot: publishSnapshotPublicationToMaven3Repository
5660

61+
tasks.jar {
62+
manifest {
63+
attributes('Automatic-Module-Name': project.property('mavenGroupId'))
64+
}
65+
}
66+
5767
task sourceJar(type: Jar) {
68+
outputs.cacheIf { true }
5869
from sourceSets.main.allJava
5970
archiveClassifier = 'sources'
6071
}
6172

6273
task javadocJar(type: Jar, dependsOn: javadoc) {
74+
outputs.cacheIf { true }
6375
from javadoc.destinationDir
6476
archiveClassifier = 'javadoc'
6577
}

gradle.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
# The size of the library demands a large amount of RAM to build. Increase as necessary if you get GC errors
2121
## linux requires 10G, OSX requires 11G
2222
org.gradle.jvmargs=-XX:MaxPermSize=512m -Xmx2g
23+
org.gradle.parallel=true
2324
org.gradle.caching=true
2425

2526
mavenGroupId = com.microsoft.graph
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

src/main/java/com/microsoft/graph/authentication/IAuthenticationProvider.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@
2626

2727
/**
2828
* Provides authentication for a requests before it is sent by an HTTP provider
29+
* @deprecated use ICoreAuthenticationProvider instead
2930
*/
31+
@Deprecated
3032
public interface IAuthenticationProvider {
3133

3234
/**

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ public ChunkedUploadResult<UploadType> generateResult(
176176
in = new BufferedInputStream(response.body().byteStream());
177177
final String rawJson = DefaultHttpProvider.streamToString(in);
178178
final UploadSession session = serializer.deserializeObject(rawJson, UploadSession.class);
179-
if(session == null) {
179+
if(session == null || session.nextExpectedRanges == null) {
180180
logger.logDebug("Upload session is completed (ODSP), uploaded item returned.");
181181
final UploadType uploadedItem = serializer.deserializeObject(rawJson, this.deserializeTypeClass);
182182
return new ChunkedUploadResult<UploadType>(uploadedItem);

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

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232
import com.microsoft.graph.serializer.DefaultSerializer;
3333
import com.microsoft.graph.serializer.ISerializer;
3434

35+
import okhttp3.OkHttpClient;
36+
3537
/**
3638
* The default configuration for a service client
3739
*/
@@ -55,7 +57,7 @@ public abstract class DefaultClientConfig implements IClientConfig {
5557
/**
5658
* The serializer instance
5759
*/
58-
private DefaultSerializer serializer;
60+
private ISerializer serializer;
5961

6062
/**
6163
* Creates an instance of this configuration with an authentication provider
@@ -97,11 +99,22 @@ public IAuthenticationProvider getAuthenticationProvider() {
9799
*/
98100
@Override
99101
public IHttpProvider getHttpProvider() {
102+
return this.getHttpProvider(null);
103+
}
104+
105+
/**
106+
* Gets the HTTP provider
107+
*
108+
* @param httpClient the http client to pass to the http provider when building it
109+
* @param <T1> the http client type
110+
* @return the HTTP provider
111+
*/
112+
@Override
113+
public <T1> IHttpProvider getHttpProvider(final T1 httpClient) {
100114
if (httpProvider == null) {
101-
httpProvider = new CoreHttpProvider(getSerializer(),
102-
getAuthenticationProvider(),
103-
getExecutors(),
104-
getLogger());
115+
httpProvider = (httpClient instanceof OkHttpClient) ?
116+
new CoreHttpProvider(this, (OkHttpClient) httpClient) :
117+
new CoreHttpProvider(this, null);
105118
getLogger().logDebug("Created CoreHttpProvider");
106119
}
107120
return httpProvider;

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,15 @@ public interface IClientConfig {
5353
*/
5454
IHttpProvider getHttpProvider();
5555

56+
/**
57+
* Gets the HTTP provider
58+
*
59+
* @param httpClient the http client to pass to the http provider when building it
60+
* @param <T1> the http client type
61+
* @return the HTTP provider
62+
*/
63+
<T1> IHttpProvider getHttpProvider(final T1 httpClient);
64+
5665
/**
5766
* Gets the logger
5867
*

0 commit comments

Comments
 (0)