java - Microsoft Sharepoint 在线列出文件夹中的所有文件
问题描述
我想在位于共享点的目录中获取所有文件和目录的列表我没有使用 REST api 的经验,我无法在谷歌上找到解决的这个特定问题我有当前代码:
HttpURLConnection sharepoint = new LoginManager().login();
String siteURL = "https://confidential.sharepoint.com/something/"; //here <siteURL_path> is '/teams/SPdev/AlertsCount'
String wsUrl = siteURL + "/_api/web/GetFolderByServerRelativeUrl('TheFolder')";
//Send Request
InputStream in = sharepoint.getInputStream();
//Read the response.
String responseStr = "";
if (sharepoint.getResponseCode() == 302)
{
responseStr = "Folder read. ResponseCode: " + sharepoint.getResponseCode();
}
else
{
responseStr += "Error while reading folder, ResponseCode: " + sharepoint.getResponseCode() + " " + sharepoint.getResponseMessage();
}
System.out.println(responseStr);
LoginManager 是我在此之后所做的: https ://social.technet.microsoft.com/Forums/office/en-US/4c8d3696-1d41-44e3-897c-ac3c0b44f66a/share-point-online-authentication-using-java ?forum=sharepointsearch
解决方案
推荐阅读
- c# - 没有“IEnumerable”类型的 ViewData 项
' 具有 ASP.NET MVC 中的密钥 - c# - C#:在winform上使用定时器来改变图表,定时器需要单独的方法,图表数据不能从单独的方法中编辑
- node.js - 如何在较大的架构中使用具有引用的较小架构?
- vue.js - vuex 未知突变类型:Nativescript 应用程序
- sum - AMPL如何有一个求和约束
- scala - 是否可以将隐式传递给 PartialFunction?
- extjs3 - ExtJS 3.2.1 Combobox 下拉设置值(如果存在)
- angular - Angular 2+中的状态基础路由或带有状态的抽象路由
- ruby-on-rails - 用于多租户应用程序(子域)的 ngrok + stripe webhook
- javascript - 如何为 fullcalendar.io 获得正确的格式