From f89ceec41b84d0c3f5e8eef5426795c2207ab61d Mon Sep 17 00:00:00 2001 From: Kris Oblucki Date: Tue, 11 Dec 2018 16:57:07 -0800 Subject: [PATCH] An attempt to cast BufferedInputStream to ProfilePhoto fails Fixes issue 176 --- .../requests/extensions/ProfilePhotoStreamRequest.java | 7 ++++--- .../requests/generated/BaseProfilePhotoStreamRequest.java | 8 ++++---- .../generated/IBaseProfilePhotoStreamRequest.java | 4 ++-- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/microsoft/graph/requests/extensions/ProfilePhotoStreamRequest.java b/src/main/java/com/microsoft/graph/requests/extensions/ProfilePhotoStreamRequest.java index 4797d460efa..756fc751d9e 100644 --- a/src/main/java/com/microsoft/graph/requests/extensions/ProfilePhotoStreamRequest.java +++ b/src/main/java/com/microsoft/graph/requests/extensions/ProfilePhotoStreamRequest.java @@ -8,7 +8,7 @@ import com.microsoft.graph.models.extensions.ProfilePhoto; import com.microsoft.graph.options.Option; import com.microsoft.graph.requests.generated.BaseProfilePhotoStreamRequest; - +import java.io.InputStream; // This file is available for extending, afterwards please submit a pull request. /** @@ -23,7 +23,8 @@ public class ProfilePhotoStreamRequest extends BaseProfilePhotoStreamRequest imp * @param client the service client * @param requestOptions the options for this request */ - public ProfilePhotoStreamRequest(final String requestUrl, final IBaseClient client, final java.util.List requestOptions) { - super(requestUrl, client, requestOptions, ProfilePhoto.class); + public ProfilePhotoStreamRequest(final String requestUrl, final IBaseClient client, + final java.util.List requestOptions) { + super(requestUrl, client, requestOptions, InputStream.class); } } diff --git a/src/main/java/com/microsoft/graph/requests/generated/BaseProfilePhotoStreamRequest.java b/src/main/java/com/microsoft/graph/requests/generated/BaseProfilePhotoStreamRequest.java index a29dd9d7abd..9c9e40a793c 100644 --- a/src/main/java/com/microsoft/graph/requests/generated/BaseProfilePhotoStreamRequest.java +++ b/src/main/java/com/microsoft/graph/requests/generated/BaseProfilePhotoStreamRequest.java @@ -24,7 +24,7 @@ /** * The class for the Base Profile Photo Stream Request. */ -public class BaseProfilePhotoStreamRequest extends BaseStreamRequest implements IBaseProfilePhotoStreamRequest { +public class BaseProfilePhotoStreamRequest extends BaseStreamRequest implements IBaseProfilePhotoStreamRequest { /** * The request for this ProfilePhoto @@ -38,7 +38,7 @@ public BaseProfilePhotoStreamRequest( final String requestUrl, final IBaseClient client, final java.util.List requestOptions, - final Class responseClass) { + final Class responseClass) { super(requestUrl, client, requestOptions, responseClass); } @@ -67,7 +67,7 @@ public InputStream get() throws ClientException { * @param fileContents the contents of the stream to upload * @param callback the callback to be called after success or failure */ - public void put(final byte[] fileContents, final ICallback callback) { + public void put(final byte[] fileContents, final ICallback callback) { send(fileContents, callback); } @@ -78,7 +78,7 @@ public void put(final byte[] fileContents, final ICallback callbac * @return the result of the upload * @throws ClientException an exception occurs if there was an error while the request was sent */ - public ProfilePhoto put(final byte[] fileContents) throws ClientException { + public InputStream put(final byte[] fileContents) throws ClientException { return send(fileContents); } } diff --git a/src/main/java/com/microsoft/graph/requests/generated/IBaseProfilePhotoStreamRequest.java b/src/main/java/com/microsoft/graph/requests/generated/IBaseProfilePhotoStreamRequest.java index ca4083987cf..01cbf5da770 100644 --- a/src/main/java/com/microsoft/graph/requests/generated/IBaseProfilePhotoStreamRequest.java +++ b/src/main/java/com/microsoft/graph/requests/generated/IBaseProfilePhotoStreamRequest.java @@ -47,7 +47,7 @@ public interface IBaseProfilePhotoStreamRequest extends IHttpStreamRequest { * @param fileContents the contents of the stream to upload * @param callback the callback to be called after success or failure */ - void put(final byte[] fileContents, final ICallback callback); + void put(final byte[] fileContents, final ICallback callback); /** * Uploads to the stream @@ -56,5 +56,5 @@ public interface IBaseProfilePhotoStreamRequest extends IHttpStreamRequest { * @return the result of the upload * @throws ClientException an exception occurs if there was an error while the request was sent */ - ProfilePhoto put(final byte[] fileContents) throws ClientException; + InputStream put(final byte[] fileContents) throws ClientException; }