microsoft-graph-devx-api icon indicating copy to clipboard operation
microsoft-graph-devx-api copied to clipboard

wrong snippets for java onedrive/onenote/sharepoint content download

Open baywet opened this issue 5 years ago • 0 comments

Fore the following pages:

  • https://docs.microsoft.com/en-us/graph/api/driveitem-get-content?view=graph-rest-1.0&tabs=java
  • https://docs.microsoft.com/en-us/graph/api/driveitem-get-content-format?view=graph-rest-1.0&tabs=java
  • https://docs.microsoft.com/en-us/graph/api/resource-get?view=graph-rest-1.0&tabs=java

the sample should be along the lines of

IGraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();

InputStream stream = graphClient
    			.me()
    			.drive()
    			.items(itemId)
			.content()
			.buildRequest()
			.get();

and not using the custom request builder.

Related to

  • https://github.com/microsoftgraph/msgraph-sdk-java/issues/331
  • https://github.com/microsoftgraph/msgraph-sdk-java/issues/309 AB#6993

baywet avatar Sep 10 '20 14:09 baywet