title: Connection Reset when attempting to list all files from a Sharefolder
body: <p>I am trying to recursively check for a specific file in my company sharefolder using <code>SmbFile</code> and <code>NtlmPasswordAuthentication</code>.
  <br><br></p>
  
  <p>As I am not very knowledgeable in Java I followed examples found in the internet but I keep getting the following error whenever I try to do a <code>root.listFiles()</code> :
  <br></p>
  
  <pre><code>jcifs.smb.SmbException: Failed to connect: foldername/xx.xx.xx.xxx
  jcifs.util.transport.TransportException
  java.net.SocketException: Connection reset
  </code></pre>
  
  <p><br>
  I do have access rights to the sharefolder so my initial thought is that something is missing from my code but instead an authentication or proxy error. I am using the url in the following format: <code>smb://foldername/something/somethingelse/anothersomething/</code>
  <br>
  <br>
  My code:</p>
  
  <pre><code>    public static Boolean checkDiretory(String location, String docName){
          Boolean result = false;
          try {
              NtlmPasswordAuthentication auth = new NtlmPasswordAuthentication("", Consts.username, Consts.password);
              SmbFile root = new SmbFile(location, auth);
              List&lt;SmbFile&gt; files = Arrays.asList(root.listFiles());
              for(SmbFile file : files){
                  if(file.isDirectory()){
                      result = checkDiretory(file.getPath(), docName);
                      if(result)
                          return result;
                  }
                  else{
                      if(file.exists() &amp;&amp; file.getName().contains(docName)){
                          return true;
                      }else{
                          result = false;
                      }
                  }
              }
          } catch (SmbException e) {
              e.printStackTrace();
          } catch (MalformedURLException e) {
              e.printStackTrace();
          }
          return result;
      }
  </code></pre>