我尝试遵循此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
在第一行。
请帮忙。
最佳答案
当您集成来自 Github 的纯 .jar 文件时,您还需要包含 unirest 库,因为 CloudRail SDK 中需要它。您可以在这里下载:https://github.com/Mashape/unirest-java
关于java - 使用 Cloudrail 将文件上传到 OneDrive 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46580032/