I am trying to connect to SharePoint from my Java code. Below is the code I am using,
NtlmAuthenticator credentials = new NtlmAuthenticator("DOMAIN", "username", "password");
// Initialize proxy settings
HttpProxy httpProxy = new HttpProxy("myProxyServer.com", 8888);
// Connect to Sharepoint
SPSite instance = new SPSite(new URL("https://www.server.com/"), credentials, httpProxy, true, SPVersion.SP2013);
// Get root web instance
SPWeb rootWeb = instance.getRootWeb();
// Get list of all lists and document libraries from root web
List<SPList> lists = rootWeb.getLists();
However I am not able to connect. Also i am not getting what to pass for the proxy field.
Can you please help me?
0 commentaires:
Enregistrer un commentaire