title: Trouble writing to file with SMBJ
body: <p>Please help. I am unable to create and write to a file using SMBJ. I'm getting this error:</p>
  
  <pre><code>com.hierynomus.mssmb2.SMBApiException: STATUS_OBJECT_NAME_NOT_FOUND (0xc0000034): Create failed for &lt;file path&gt;
  </code></pre>
  
  <p>Is this a Windows errors or an SMBJ error? Am I using the SMBJ API correctly? I don't understand Windows file attributes/options well.</p>
  
  <pre><code>String fileName ="EricTestFile.txt";
  String fileContents = "Mary had a little lamb.";
  
  SMBClient client = new SMBClient();
  try (Connection connection = client.connect(serverName)) {
      AuthenticationContext ac = new AuthenticationContext(username, password.toCharArray(), domain);
      Session session = connection.authenticate(ac);
  
      // Connect to Share
      try (DiskShare share = (DiskShare) session.connectShare(sharename)) {
          for (FileIdBothDirectoryInformation f : share.list(folderName, "*.*")) {
              System.out.println("File : " + f.getFileName());
          }
  
          //share.openFile(path, accessMask, attributes, shareAccesses, createDisposition, createOptions)
          Set&lt;FileAttributes&gt; fileAttributes = new HashSet&lt;&gt;();
          fileAttributes.add(FileAttributes.FILE_ATTRIBUTE_NORMAL);
          Set&lt;SMB2CreateOptions&gt; createOptions = new HashSet&lt;&gt;();
          createOptions.add(SMB2CreateOptions.FILE_RANDOM_ACCESS);
          File f = share.openFile(folderName+"\\"+fileName, new HashSet(Arrays.asList(new AccessMask[]{AccessMask.GENERIC_ALL})), fileAttributes, SMB2ShareAccess.ALL, SMB2CreateDisposition.FILE_OVERWRITE, createOptions);
  
          OutputStream oStream = f.getOutputStream();
          oStream.write(fileContents.getBytes());
          oStream.flush();
          oStream.close();
      }
  } catch (IOException e) {
      e.printStackTrace();
  }
  </code></pre>