jcifs - Login on smb with java -


i'm trying list of files of smb-share secured user , password. working perfectly. if try open file on smb-share, windows requires me login again in prompt. have required username , password. can login in code before opening file?

accessing files jcifs:

        ntlmpasswordauthentication auth = new ntlmpasswordauthentication(                 rootfolderpath, user, passwort);         smbfile smbserver;         try {             smbserver = new smbfile("smb://" + rootfolderpath, auth);          } catch (malformedurlexception e) {             e.printstacktrace();             continue;         } catch (smbexception e) {             e.printstacktrace();         } 

a solution usage of "net use"


Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -