Skip to content

Commit 525d471

Browse files
author
Caitlin Bales (MSFT)
authored
Merge pull request #72 from microsoftgraph/java7
Target Java 7
2 parents 6e1aedf + 0de077a commit 525d471

File tree

5 files changed

+24
-15
lines changed

5 files changed

+24
-15
lines changed

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
}

src/main/java/com/microsoft/graph/serializer/ByteArraySerializer.java

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,8 @@
2222

2323
package com.microsoft.graph.serializer;
2424

25-
import java.util.Base64;
26-
import java.util.Base64.Decoder;
27-
import java.util.Base64.Encoder;
25+
import com.google.common.io.BaseEncoding;
26+
2827
import java.text.ParseException;
2928

3029
/**
@@ -46,8 +45,7 @@ private ByteArraySerializer() {
4645
* @throws ParseException if there is any problem processing the value
4746
*/
4847
public static byte[] deserialize(final String strVal) throws ParseException {
49-
Decoder base64Decoder = Base64.getDecoder();
50-
return base64Decoder.decode(strVal);
48+
return BaseEncoding.base64().decode(strVal);
5149
}
5250

5351
/**
@@ -57,7 +55,6 @@ public static byte[] deserialize(final String strVal) throws ParseException {
5755
* @return the string
5856
*/
5957
public static String serialize(final byte[] src) {
60-
Encoder base64Encoder = Base64.getEncoder();
61-
return base64Encoder.encodeToString(src);
58+
return BaseEncoding.base64().encode(src);
6259
}
6360
}

src/main/java/com/microsoft/graph/serializer/DefaultSerializer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ private JsonObject getChildAdditionalData(IJsonBackedObject serializableObject,
159159
Iterator<Entry<String, Object>> it = serializableChildren.entrySet().iterator();
160160

161161
while (it.hasNext()) {
162-
HashMap.Entry<String, Object> pair = (HashMap.Entry<String, Object>)it.next();
162+
Map.Entry<String, Object> pair = (Map.Entry<String, Object>)it.next();
163163
Object child = pair.getValue();
164164

165165
// If the item is a valid Graph object, add its additional data

src/test/java/com/microsoft/graph/functional/SharePointTests.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
import org.junit.*;
1111
import static org.junit.Assert.*;
1212

13-
import java.util.Base64;
1413
import java.util.LinkedList;
1514
import java.util.List;
1615

src/test/java/com/microsoft/graph/functional/WebhooksTests.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import org.junit.Test;
77
import static org.junit.Assert.*;
88

9-
import java.util.Base64;
109
import java.util.Calendar;
1110

1211
@Ignore

0 commit comments

Comments
 (0)