title: Connecting SharePoint in Java
body: <p>I am trying to connect to the SharePoint from my java code. However there seems to be something is missing and I am not able to connect to the sharepoint.</p>
  
  <p>I am using the below code,</p>
  
  <pre><code>    NtlmAuthenticator credentials = new NtlmAuthenticator("domain", "uname", "Password");
  
      // Initialize proxy settings
      //HttpProxy httpProxy = new HttpProxy("my_system_proxy", 80);
  
      // Connect to Sharepoint
      SPSite instance = new SPSite(new URL("https://my_url/cplc/projects/Knowledge%20Share/Forms/PracticeWise.aspx"), credentials, null, true, SPVersion.SP2013);
  
      // Get root web instance
      SPWeb rootWeb = instance.getRootWeb();
  
      // Get list of all lists and document libraries from root web
      SPListCollection lists = rootWeb.getLists(); 
  </code></pre>
  
  <p>I don't know what value I should set for proxy field there.</p>
  
  <p>If I don't set the proxy and send null to it, it says   <strong>"401: UnAuthorised"
               HTTP transport error: java.net.UnknownHostException: proxy.msa"</strong></p>
  
  <p><strong>Update:</strong></p>
  
  <p>I am referring this,</p>
  
  <p><a href="https://code.google.com/p/java-sharepoint-library/" rel="nofollow">https://code.google.com/p/java-sharepoint-library/</a></p>
  
  <p>Can anybody please help me to proceed further?</p>