[jcifs] copyTo, codepages, getType(), plain text passw....

Michael B. Allen miallen at eskimo.com
Thu Aug 1 19:33:09 EST 2002


I have implemented:

 o A jcifs.smb.client.codepage property to specify the codepage the
   client should use to decode 8 bit strings
 o A getType() method that returns
   TYPE_{WORKGROUP,SERVER,SHARE,NAMED_PIPE,PRINTER,FILESYSTEM} and
   deprecated isWorkgroup
 o A lookup table for NbtAddress like InetAddress has to prevent redundant
   queries from going out on the wire
 o Plain text passwords
 o A freeDiskSpace() method that returns free disk space and calling
   length() on a share returns the disks capacity

And  last  but  not least, I just implemented copyTo. There's good news and
bad  news  though.  The  bad news is that the CIFS message SMB_COM_COPY for
copying files is broken on all Microsoft servers and therefore we can't use
it  which  is  a  real shame because copying a file on the same remote host
means  reading  it all down and writing it all back. Yuck! The good news is
that  I  have  optimized  this  operation  to  recursively  copy  files and
directories and in  a  way that's A LOT faster than Windows. I used the the
internal  API  so I wasn't building and tearing down SmbFileXxxput streams,
double  buffers,  and  an  extra WriterThread so that the main thread would
read  a chunk of data, trigger  the WriterThread, switch buffers, do a read
(which  the WriterThread is writing the other buffer), and so on. I ran one
simple test: 

 Results of copying a largish directory on NT from a Win98 machine VS.
 with jCIFS copyTo:

  Win98 <--> NT: 2 minutes 24 seconds
  jCIFS <--> NT: 1 minute 1 seconds

-- 
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 importantly to tasks that have not
yet been conceived. 




More information about the jcifs mailing list