Java 使用MS GraphAPI将(小)文件上载到sharepoint文件夹。文件过时
我想将小文件上载到sharepoint文件夹。我在里面找到了样品。 不幸的是,提供的示例语法不正确-无法编译!文档可能没有更新以反映最新(v3)的更改 方法Java 使用MS GraphAPI将(小)文件上载到sharepoint文件夹。文件过时,java,sharepoint,microsoft-graph-api,Java,Sharepoint,Microsoft Graph Api,我想将小文件上载到sharepoint文件夹。我在里面找到了样品。 不幸的是,提供的示例语法不正确-无法编译!文档可能没有更新以反映最新(v3)的更改 方法put()不再接受stream。它只接受DriveItem,但我找不到用stream初始化它的方法 @Nullable public DriveItem put(@Nonnull final DriveItem newDriveItem) throws ClientException { return (DriveItem)this.
put()
不再接受stream
。它只接受DriveItem
,但我找不到用stream初始化它的方法
@Nullable
public DriveItem put(@Nonnull final DriveItem newDriveItem) throws ClientException {
return (DriveItem)this.send(HttpMethod.PUT, newDriveItem);
}
有人能提供工作示例吗?和/或列出当前(功能)文档。。。谢谢。我认为正确的方法是在
.items()之后添加.content()
@Nullable
public DriveItem put(@Nonnull final DriveItem newDriveItem) throws ClientException {
return (DriveItem)this.send(HttpMethod.PUT, newDriveItem);
}
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
byte[] stream = Base64.getDecoder().decode("The contents of the file goes here.");
graphClient.me().drive().items("{item-id}")
.content()
.buildRequest()
.put(_stream_);