[jcifs] Having problem with simply connecting with release 1.2.9

Michael B Allen mba2000 at ioplex.com
Wed May 10 16:54:33 GMT 2006

On Wed, 10 May 2006 07:03:21 +0200
Thomas Bley <thomas.bley at simple-groupware.de> wrote:

> Hi,
> I also had this Exception with listFiles() (no OutputStream).
> When running with JRE, Cp850 is not supported and the 
> NullpointerException comes up.
> I'm using this code to decide the right encoding for jCIFS:
> if (java.nio.charset.Charset.isSupported("IBM850")) { // JDK
>   jcifs.Config.setProperty( "jcifs.encoding", "Cp850" );
> } else { // JRE
>   jcifs.Config.setProperty( "jcifs.encoding", "Cp1252" );
> }
> Using Cp1252 the German Umlaute are not working in shares names, but 
> that's not so bad.

Yeah, nothing but Cp850 is going to work I'm afraid. The proper solution
is to use the NetrShareEnum RPC. But your solution is certainly better
than throwing a NullPointerException.

I'll add it to The List.


More information about the jcifs mailing list