Why is my java class not connecting to remote drive using smb?
String user = "user1";
String pass ="pass234";
String sharedFolder="c$\\WebDocs2\\AutoFrameworkResults\\";
String path= "smb:" +"\\" + "\\192.xx.1.xx\\" + sharedFolder + "Example.txt";
NtlmPasswordAuthentication auth = new NtlmPasswordAuthentication("",user, pass);
SmbFile smbFile = new SmbFile(path,auth);
SmbFileOutputStream smbfos = new SmbFileOutputStream(smbFile);
smbfos.write("testing....and writing to a file".getBytes());
System.out.println("completed ...nice !");
Im getting the following Exception (But the username and password credentials are correct)?`
Exception in thread "main" jcifs.smb.SmbAuthException: Logon failure: unknown user name or bad password.
at jcifs.smb.SmbSession.sessionSetup(SmbSession.java:406)
at jcifs.smb.SmbSession.send(SmbSession.java:218)
at jcifs.smb.SmbTree.treeConnect(SmbTree.java:176)