Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
Nightly Builds
-
None
Description
If you have a shared folder without authentication, SmbFileObject throws an NPE in method createSmbFile().
Here is what I changed to get it to run:
private SmbFile createSmbFile(FileName fileName) throws MalformedURLException, SmbException, FileSystemException
{
SmbFileName smbFileName = (SmbFileName) fileName;
String path = smbFileName.getUriWithoutAuth();
UserAuthenticationData authData = null;
SmbFile file;
NtlmPasswordAuthentication auth;
try
{
authData = UserAuthenticatorUtils.authenticate(getFileSystem().getFileSystemOptions(), SmbFileProvider.AUTHENTICATOR_TYPES);
if (authData!=null)
else
{ auth=null; file = new SmbFile(path); } }
finally
if (file.isDirectory() && !file.toString().endsWith("/"))
{
if (auth!=null)
else
{ file = new SmbFile(path + "/"); }}
return file;
}