[jcifs] File naming problem

Michael B Allen mba2000 at ioplex.com
Thu Dec 29 17:40:19 GMT 2005


On Thu, 29 Dec 2005 03:30:05 +0000 (UTC)
Alvin Anwar <alvin_anwar at msn.com> wrote:

> Hi all,
> 
> Currently I noticed there's an inconsistency error in getting the 
> files' names for different level of shared directory. Let me elaborate 
> first. *Please correct me if I'm wrong somewhere, it might be my mistake
> after all*
> 
> In JCIFS SmbFile getType() function, the shared directory is 
> specified as
> \\ TYPE_SERVER \ TYPE_SHARE \ TYPE_FILESYSTEM \ TYPE_FILESYSTEM ...
> 
> Currently I'm working on using JCIFS on file servers running Windows XP
> SP 2 Chinese version. The unstability was found when I tries to list 
> the files using listFiles() from SmbFile class at server level
> (TYPE_SERVER). 
> 
> When I retrieve the name and display it in a webpage (using IntergraTUM
> WebDisk), some of the shared directory with Chinese characters are 
> retrieved wrongly (which makes everything a broken link). On the other 

To retrieve server and share lists jCIFS uses an older "RAP" protocol
that does not support Unicode. MSRPC is necessary to properly enumerate
servers and shares that contain Unicode characters. We have implemented
MSRPC via a project called Jarapac and there are example programs that
can properly emumerate shares. But that work was never integrated before
people moved on to other things. Currently jCIFS is in maintainence mode.

But it is strange that the servers and shares are listed at all. Try the
examples/ListFiles.java example in the JCIFS packae. One possability is
that the server you are communicating with isn't negotiating Unicode but
is using the OEM codeset instead. If this is the case the RAP functions
might actually work if you change the jcifs.encoding property (see the
Overview page of the API documentation).

Mike


More information about the jcifs mailing list