Я хочу получить список всех файлов и каталогов в директории, расположенной на sharepoint. У меня нет опыта работы с REST API, и я не могу найти эту конкретную c проблема решена в Google. У меня есть текущий код:
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