Skip to content
This repository was archived by the owner on Sep 4, 2020. It is now read-only.

Commit 0371643

Browse files
author
Brian Melton
committed
Reverting some changes to interfaces to avoid breaking changes
1 parent 3d9191d commit 0371643

4 files changed

Lines changed: 37 additions & 17 deletions

File tree

graphsdk/src/androidTest/java/com/microsoft/graph/http/MockConnection.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,13 @@ public String getRequestMethod() {
6767
}
6868

6969
@Override
70-
public void setContentLength(int length) {
70+
public int getContentLength() {
71+
return mData.getJsonResponse().length();
72+
}
7173

74+
@Override
75+
public void setContentLength(int length) {
76+
// noop
7277
}
7378

7479
}

graphsdk/src/main/java/com/microsoft/graph/http/IConnection.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,13 @@ public interface IConnection {
9898
*/
9999
String getRequestMethod();
100100

101+
/**
102+
* Returns the Content-Length.
103+
*
104+
* @return The content length.
105+
*/
106+
int getContentLength();
107+
101108
/**
102109
* Set the Content-Length header
103110
*

graphsdk/src/main/java/com/microsoft/graph/http/IHttpProvider.java

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222

2323
package com.microsoft.graph.http;
2424

25-
2625
import com.microsoft.graph.concurrency.ICallback;
2726
import com.microsoft.graph.core.ClientException;
2827
import com.microsoft.graph.serializer.ISerializer;
@@ -34,18 +33,20 @@ public interface IHttpProvider {
3433

3534
/**
3635
* Get the serializer for this http provider.
36+
*
3737
* @return The serializer for this provider.
3838
*/
3939
ISerializer getSerializer();
4040

4141
/**
4242
* Sends the http request asynchronously.
43-
* @param request The request description.
44-
* @param callback The callback to be called after success or failure.
45-
* @param resultClass The class of the response from the service.
43+
*
44+
* @param request The request description.
45+
* @param callback The callback to be called after success or failure.
46+
* @param resultClass The class of the response from the service.
4647
* @param serializable The object to send to the service in the body of the request.
47-
* @param <Result> The type of the response object.
48-
* @param <BodyType> The type of the object to send to the service in the body of the request.
48+
* @param <Result> The type of the response object.
49+
* @param <BodyType> The type of the object to send to the service in the body of the request.
4950
*/
5051
<Result, BodyType> void send(final IHttpRequest request,
5152
final ICallback<Result> callback,
@@ -55,11 +56,12 @@ <Result, BodyType> void send(final IHttpRequest request,
5556

5657
/**
5758
* Sends the http request.
58-
* @param request The request description.
59-
* @param resultClass The class of the response from the service.
59+
*
60+
* @param request The request description.
61+
* @param resultClass The class of the response from the service.
6062
* @param serializable The object to send to the service in the body of the request.
61-
* @param <Result> The type of the response object.
62-
* @param <BodyType> The type of the object to send to the service in the body of the request.
63+
* @param <Result> The type of the response object.
64+
* @param <BodyType> The type of the object to send to the service in the body of the request.
6365
* @return The result from the request.
6466
* @throws ClientException This exception occurs if the request was unable to complete for any reason.
6567
*/
@@ -70,12 +72,13 @@ <Result, BodyType> Result send(final IHttpRequest request,
7072

7173
/**
7274
* Sends the http request.
73-
* @param request The request description.
74-
* @param resultClass The class of the response from the service.
75-
* @param serializable The object to send to the service in the body of the request.
76-
* @param handler The handler for stateful response.
77-
* @param <Result> The expected return type return.
78-
* @param <BodyType> The type of the object to send to the service in the body of the request.
75+
*
76+
* @param request The request description.
77+
* @param resultClass The class of the response from the service.
78+
* @param serializable The object to send to the service in the body of the request.
79+
* @param handler The handler for stateful response.
80+
* @param <Result> The expected return type return.
81+
* @param <BodyType> The type of the object to send to the service in the body of the request.
7982
* @param <DeserializeType> The type of the http response object.
8083
* @return The expected result object for the request.
8184
* @throws ClientException This exception occurs if the request was unable to complete for any reason.

graphsdk/src/main/java/com/microsoft/graph/http/UrlConnection.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,11 @@ public InputStream getInputStream() throws IOException {
9696
}
9797
}
9898

99+
@Override
100+
public int getContentLength() {
101+
return mConnection.getContentLength();
102+
}
103+
99104
@Override
100105
public int getResponseCode() throws IOException {
101106
return mConnection.getResponseCode();

0 commit comments

Comments
 (0)