[jcifs] Handler.SMB_HANDLER problem

Juanmi pirausta at gmail.com
Wed Oct 15 08:10:59 GMT 2008


Hello,

I want to use my own  Handler for SMB files that doesn´t filter leading an
trailing whitespaces. Actually URL is filtering those characters an
jcifs.smb.Handler is using the URL int start, int limit. The problem is that
SmbFile alwais use jcifs.smb.Handler.

Example of own Handler:

public class OwnHandel extends jcifs.smb.Handler{
   protected void parseURL( URL u, String spec, int start, int limit ) {
           super.parseURL(u,spec,0,spec.length);
    }
}

Modification Proposal for the API:

Change jcifs.smb.Handler and make the field SMB_HANDLER public and not final,
this way we can inyect our own Handlers:

package jcifs.smb;

import ....
public class Handler extends URLStreamHandler {

    public static URLStreamHandler SMB_HANDLER = new Handler();
.....
}





More information about the jcifs mailing list