[jcifs] Incorrect type set by listFiles()
Michael B. Allen
miallen at eskimo.com
Sat Nov 16 15:50:46 EST 2002
On Fri, 15 Nov 2002 01:23:12 -0600
dircha at bethel.edu wrote:
> I am encountering this error with both jcifs 0.7.0b7 and 0.7.0b8:
> The value returned by jcifs.smb.SmbFile.getType() differs for an SmbFile object
> returned from jcifs.smb.SmbFile.listFiles() and an SmbFile object constructed
> with the same path as that returned in the results of listFiles().
> Where "BG" is a computer on the network and "SharedDocs" is a share on "BG".
> SmbFile file = new SmbFile("smb://BG/SharedDocs/");
> file.getType() correctly reports the path as representing a type of TYPE_SHARE
> file.listFiles() correctly gives me a list of folders on the share (which each
> correctly have a type of TYPE_FILESYSTEM)
> SmbFile file = new SmbFile("smb://BG/");
> file.getType() correctly reports the path as representing TYPE_SERVER
> SmbFile files = file.listFiles() is successful
> files.getPath() correctly gives "smb://BG/SharedDocs/"
> files.getType() INCORRECTLY gives TYPE_FILESYSTEM
> files.listFiles() INCORRECTLY throws a jcifs.smb.SmbException with the
> message "Invalid operation for IPC serviceInvalid operation for IPC service"
> The workaround I have been using currently is to create new SmbFile objects with
> the values returned by getPath() from the SmbFile objects returned by
> listFiles(). This works.
Ok. So it's pretty messed up. I don't have a test example for this sort
of thing. But it shoudn't be too hard to fix I think. Will do.
> Let me know if you want additional details, or if you want me to try other tests.
> --Chad Dirks
A program should be written to model the concepts of the task it
performs rather than the physical world or a process because this
maximizes the potential for it to be applied to tasks that are
conceptually similar and, more important, to tasks that have not
yet been conceived.
More information about the jcifs