I am writing a simple android code to create a file in my SMB folder using jcifs. But I am getting the following exception.
jcifs.smb.SmbException: A device attached to the system is not functioning.
The following is my code:
try{
String user = "X";
String pass ="X";
String sharedFolder="X";
String path="X/"+sharedFolder+"/test.txt";
NtlmPasswordAuthentication auth = new NtlmPasswordAuthentication("X",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 !");
}catch(Exception e){
e.printStackTrace();
}
I got the answer. There were some issues with the jar file version. Moral of the story: use the latest jar of jcifs