[jcifs] jcifs-0.7.19 released

Michael B Allen mba2000 at ioplex.com
Fri Jan 23 20:05:12 GMT 2004

andrea.lanza at frameweb.it said:
> Sorry, I did not explain correctly.
> I developed a set of servlet classes working on tomcat 4.x
> in order to navigate the intranet sbm net from the Internet, upload,
> download and zip and download
> files and directory and so on.
> I know that probably the NetworkExplorer class does all of this thing, but

Well NetworkExplorer cannot upload so you got me there.

> I never used that, I developed eveything
> from scratch (probably becouse when I started I didn't see that
> class........)
> When I navigate to an url that represents a folder or a share or anything
> else from a file,  I use the method listFiles() in order to see the
> content
> of that share/folder, and everything work fine also with jcifs 0.7.18.
> When I navigate to an URL tha IS a file, I use this code (sourceFile is a
> SmbFile )
>                 SmbFileInputStream in = new
> SmbFileInputStream(sourceFile);
>                 res.setContentType("application/octet-stream");
>                 res.setHeader("Content-Disposition","attachment;
> filename="
> + attributeName + httpPath + myFileName);
>                 out = res.getOutputStream();
>                 int len;
>                 while ((len = in.read(buffer)) != -1) {
>                     out.write(buffer, 0, len);
>                 } // fine while
>                 out.close();
>                 in.close();
> res is the response and doing this starts the download on the browser.
> Actually I don't know where the problem arises with 0.7.18, perhaps when I
> get the SmbFileInputStream,
>  or perhaps when I read from that SmbFileInputStream.
> If it is important for you to know this, I can downgrade to 0.7.18 and
> debug that code snipplet.

No, that's ok. What you're doing should work great.

Just beware that if signing is negotiated and you're *reading and writing
with the same server with reads and writes interleaved* you might get a
signiture varification errors. At least I did with Windows NT 4.0 SP6 and
I spent a considerable amount of time trying to decipher why. It could be
a bug in Windows NT.

Actually, can you do me a big favor? Can you try the MkCopy.java example
on your server that negotiates signing? Just run it with two paths that
refer to the same server that negotiates signing so you're reading and
writing the server at the same time. For example:

  MkCopy smb://signsvr/pub/file.doc smb://signsvr/pub/file.doc.copy

What happends? What version and service pack of windows is it?

[Warning: MkCopy.java has been mangled in the course of debugging so it
doesn't really make a copy. I think it just writes 'O's. So if you don't
get signing errors right away you might want to correct it so that it does
make a copy or also try CopyTo.java.]

> anyway, with 0.7.19 everything is OK



More information about the jcifs mailing list