How do I establish and keep an SMB connection using java?
843790Dec 3 2008 — edited Dec 6 2008I am writing an app that requires me to manipulate files on my samba network. I tried to do this using the JCIFS class and I can successfully authenticate using smbSession.logon(), but that does not keep the connection open.
Here is the code I am working with:
InetAddress ip = InetAddress.getByName("serverName");
UniAddress myDomain = new UniAddress(ip);
NtlmPasswordAuthentication auth = new NtlmPasswordAuthentication("domain", "username","password");
SmbSession.logon(myDomain, auth);
Does anyone know of a way to create an SMB connection in java, using JCIFS or not?
Thanks