I'm using JCIFS to create a directory on a Windows remote shared directory. It doesn't fail authentication, and proceeds to invoke mkdir() method. However, folder is being creating on linux file system at the root of tomcat installation foder and not at the Windows shared directory. Not getting any exceptions.
I'm using JCIFS SMB version 1.3.19. Java app is a servlet and runs on a linux box using Tomcat. When making SMB call, as shown in code block, the app creates the directory requested, but its being created at the root of Tomcat installation directory. I'm using NtlmPasswordAuthentication before invoking mkdir() method.
public void create() {
try {
String smbUrl = String.format("smb://WIN-2016-AD-DNS/profiles/" + userName);
LOGGER.info("smbUrl = " + smbUrl);
NtlmPasswordAuthentication auth = new NtlmPasswordAuthentication(domain, "jdoe", "password");
SmbFile dir = new SmbFile(smbUrl, auth);
if (dir.isDirectory()) {
LOGGER.info("Directory already exists");
} else {
try {
dir.mkdir();
LOGGER.info("Successfully created folder on share");
} catch (Exception e) {
logExceptionError("Failed to create Directory with SMB mkdir", e, 0);
}
}
} catch (Exception e) {
logExceptionError("Failed to create Directory with SMB", e, 0);
}
}
...