使用Cloudrail将文件上载到OneDrive时出错

时间:2017-10-05 07:21:17

标签: java api onedrive cloudrail

我尝试了这个CloudRail 样本。

这是我的代码:

OneDrive client = new OneDrive(new LocalReceiver(8082), CLIENT_ID, CLIENT_SECRET, REDIRECT_URI, ""); 
//I'm not sure about the parameter 'state' so I left an empty string here
//The REDIRECT_URI is "https://login.live.com/oauth20_desktop.srf"
InputStream inputStream = new FileInputStream(fileToUpload);
client.upload(fileToUpload.getPath(), inputStream, fileToUpload.length(), false);

我收到了这个错误:

  

java.lang.ClassNotFoundException:com.mashape.unirest.request.HttpRequestWithBody

在第一行。

请帮忙。

1 个答案:

答案 0 :(得分:1)

当您从Github集成普通.jar文件时,您还需要包含unirest库,因为它在CloudRail SDK中是必需的。您可以在此处下载:https://github.com/Mashape/unirest-java

相关问题