[jcifs] Reusing NetServerEnum outside of SmbFile?

Marcus Crafter crafterm at managesoft.com
Tue Jul 20 21:43:49 GMT 2004

Hi All,

Hope all is going well.

I've just stumbled across JCIFS after doing a search for some code that
is able to discover machines on a network via netbios, essentially the
same as the MSDN NetServerEnum method

After looking into the JCIFS source it looks like the code is there,
even named the same, NetServerEnum2.java which is really great.

I'd really like to be able to reuse this code in our application -
however I'm seeing a few problems in accessing it due to the 'package
scope' nature of the code.

The results from the NetServerEnum2 class are stored in a
NetServerEnum2Response inner class, which isn't accessible from outside
the package - and the actual transmission of the request/response is
inside of SmbFile at a similar package only level (method doNetEnum()).

I might have missed something so if there's another way to access this
code please let me know.

Would it be possible to open up the scope of this API somehow so that
more of the code could be accessed/reused?

Ideally I'd like to be able to call SmbFile.sendTransaction(req, resp)
and be able to inspect the response results[] array in my application.

Any thoughts?

(I'm happy to create a patch with the changes if this is ok, if some one
might be able to propose how best it could be done?)



     ,,$$$$$$$$$,      Marcus Crafter
    ;$'      '$$$$:    Computer Systems Engineer
    $:         $$$$:   ManageSoft GmbH
     $       o_)$$$:   82-84 Mainzer Landstrasse
     ;$,    _/\ &&:'   60327 Frankfurt Germany
       '     /( &&&

More information about the jcifs mailing list