[jcifs] File transfers using jcifs

Michael B Allen mba2000 at ioplex.com
Sat May 17 08:31:25 EST 2003


On Fri, 16 May 2003, Benoit Daviaud wrote:

> Hej,
> 
> I am writing a program that download a remotly shared file using
> this API. Currently the only way I found was to read from the
> SmbFileInputStream and write to a fileOutputStream in a loop with a
> buffer in between. This is not the most efficient way, but I couldn't
> manage to use the nio package facilities (the transfertTo method in
> FileChannel which is hardward optimized. Indeed I couldn't get a channel
> on the SmbFile. Never the less it works although it takes a little bit
> more CPU resource.
> My first question is : does anybody know a better way to do that ?

We do not support nio. I don't really know much about it actually.

> My second question is related to an additionnal feature of my
> program. It allows the user to interrupt the download and then continue
> it later. The problem is that to restart the download at the point
> I stopped it, I have to skip the beginning using the skip method in
> SmbFileInputStream. It looks like this function has not been reimplemented
> from InputStream, so what it does is that it downloads the beginning of
> the file and discards it. This is really not efficient and for example
> if the user doanload for 20 minutes and then interrupts, he will have to
> wait 20 minutes again before continuing . This make this interruptability
> of the download sensless as it is the same as restarting it ...
> So my second question is : is there a wait to skip the beginning of
> the file more quickly with the current release of jcifs ? Or do we have
> to wait for a futur release ?

Someone asked this once before. I believe my suggestion worked ok for them.

  http://lists.samba.org/pipermail/jcifs/2001-December/000315.html

This should have probably worked it's way into the code at some point. I
guess I forgot.

Mike




More information about the jcifs mailing list