public static SmbFile connectToRootDirectoryWithAuthentication(String smbURL, String domain, String login,
String password) throws Exception {
StopWatch sw = new StopWatch();
// Create authentication object
NtlmPasswordAuthentication auth = new NtlmPasswordAuthentication(domain, login, password);
// Connect to share using the samba URL specified
sw.start();
SmbFile root = new SmbFile(smbURL, auth);
// Force connection with the share to be established before the first
// use of the file reference object