[jcifs] NullPointerException

Michael B Allen mba2000 at ioplex.com
Fri Jun 4 19:37:59 GMT 2004


eglass1 at comcast.net said:
>> Dear all,
>> I am new to the jcifs, to the point that I have not managed running even
>> the examples:
>>
>> java -Djcifs.properties=jcifs.prp -classpath ..\jcifs-0.9.1.jar;.
>> FileInfo
>> O:\SQLNET\TNSNAMES.ORA 1
>>            toURL: o:\SQLNET\TNSNAMES.ORA
>> Exception in thread "main" java.lang.NullPointerException
<snip>
> As a side note, it might be useful to have the SmbFile constructor check
> for a leading "\\" in the string argument; if present, convert:
>
>     \\server\share\dir\file
>
> to
>
>     smb://server/share/dir/file
>
> This would provide a more direct "drop-in" replacement (as java.io.File
> allows UNC names on Windows).

I don't think we can do that. At least not consistently. Many of the
SmbFile constructors call the java.net.URL constructor in a way that would
make it difficult if not impossible to intercept this condition. I could
be wrong but I think it would probably introduce more trouble than it's
worth.

As for the NullPointerException we should probably not be throwing that
regardless of the input. I'll have to look at that.

Mike


More information about the jcifs mailing list