Wed Jan  7 19:24:59 EST 2004
jcifs-0.7.18 released

The NTLM HTTP Authentication Filter should now work with domain controllers
that  negotiate signing as well as without generating the benign "exception
reading  from socket input" Exception. Also, the NtlmPasswordAuthentication
class  is  now  Serializable to increase compatability with certain Servlet
containers. 

Tue Dec 23 03:43:15 EST 2003
jcifs-0.7.17 released

JCIFS  will  now suppress the harmess "exception reading from socket input"
message  being  written  to  the log.

Tue Dec  9 18:13:25 EST 2003
jcifs-0.7.16 released

An issue regarding writing to NetWare 6 servers has been resolved.

jcifs-0.7.15 released

The  NTLM  HTTP  Authentication  behavoir  has been modified to permit load
balancing  between  many  domain controllers. The jcifs.smb.client.ssnLimit
property default value has also been changed to 250 from 100. 

Mon Oct  6 23:53:28 EDT 2003

jcifs-0.7.14 released

Eric's  latest  signing  patch has been merged, a few adjustments have been
made  to  eliminate  a concurrency issue, and a fix for browse servers that
return zero length server names has been incorporated. 

Wed Sep 17 21:21:31 EDT 2003

SMB  signing  is  now  supported  and  there  have been some adjustments to
SmbFile.hashCode() and SmbFile.equals() 

Mon Sep  1 19:18:52 EDT 2003

Added   code  to  logoff  1/10th  of  all  sessions  over  a  transport  if
jcifs.smb.client.ssnLimit is reached (fix for ERRSVR/90 errors).

Thu Jul 10 22:07:09 EDT 2003

Support  for  LMv2  authentication has been added.

Thu Jul  3 20:59:25 EDT 2003

There  have  been minor bug fixes in the NTLM code and SMB layer as well as
documentation updates. 

Thu Jun 12 00:22:05 EDT 2003

jcifs-0.7.9 released

A bug that could cause a connection to hang indefinately has been fixed and
some NTLM HTTP authentication tweeking has been applied. 

Wed May 28 19:09:17 EDT 2003

jcifs-0.7.8 released

A  bug in the new ntlm http client code that would cause it to hang for ~60
seconds before retreiving the target document has been fixed. 

Tue May 27 21:40:58 EDT 2003

jcifs-0.7.7 released

A  deadlock has been identified and fixed, NTLM authentication for HTTP and
HTTPS  clients  has  been  added  (the  inverse of the NtlmHttpFilter), the
SmbFileInputStream.skip()  method will skip without reading, and there have
two other small fixes. 

Wed Apr 16 22:46:07 EDT 2003

jcifs-0.7.6 released

The  isDirectory method has been changed to return false if the target does
not  exist.  Previously  this  would return true which is inconsistent with
java.io.File. 

Wed Apr  2 23:56:26 EST 2003

jcifs-0.7.5 released

More  refinement  to  the  NTLM  HTTP authentication code has been applied.
There  is  also  a fix for listing hosts from Windows ME/98/95 local master
browsers. 

Wed Mar 26 19:17:24 EST 2003

jcifs-0.7.4 released

Some NtlmHttpFilter issues were reported by several users of Win98 clients.
Eric  has  provided  a  new  NtlmSsp.java  that  works correctly with these
clients. 

Wed Feb 12 01:23:02 EST 2003

A  security issue regarding the SmbSession.logon() method used by NTLM HTTP
Authentication  has  been fixed and a modification has been made to trigger
MSIE  to  redisplay  the  Network  Password dialog repeatedly until correct
credentials are supplied. The change was made in the core jcifs.smb package
however so test this in your dev environments. 

Wed Feb  5 00:41:32 EST 2003

The   jcifs-0.7.0   and   0.7.1   releases   will   incorrectly   throw  an
ArrayIndexOutOfBounds  exception  if  a write of 1501 to 1504 is performed.
This release fixes that bug. You may also set jcifs.smb.client.snd_buf_size
=  1300  as  a  temporary work-around. It is also now possible to specify a
"ShareAccess"  with  SmbFileOutputStream  and  SmbFile  to  restrict  other
processes  from  accessing files jCIFS opens. Also, SmbFileOutputStream now
supports writing files larger than 4GB. 

Wed Jan 15 22:34:14 EST 2003

jcifs-0.7.1 released

Three  bugs have been fixed regarding filenames with '#' signs in them, the
getInputStream(),   getLastModified(),  getDate(),  and  getContentLength()
methods  of  the  URLConnection  implementation, and isExists() incorrectly
returning false. 

Thu Jan  9 00:06:23 EST 2003

jcifs-0.7.0 released

This  is  the  0.7.0  release  of  jCIFS, the Java SMB client. There is new
functionality  specifically  targeting  Web  applications  as  well as some
critical SMB URL fixes and feature improvements:

o The  new  jcifs.http package is very handy when building Web applications
  that need to integrate with MS corporate intranets. Adding a hyperlink to
  a  document  on  a  network drive is easy with Network Explorer (pictured
  right)  and  will transparently negotiate credentials with MSIE to browse
  SMB  resources  (really, no password dialog necessary). This package also
  boasts an NTLM HTTP Authentication servlet Filter for authenticating MSIE
  clients.  These are useful features because many of the tasks surrounding
  user  management  now  fall  back  to  computer support and HR. It is not
  necessary  to  add  and  remove users as they join and leave the company.
  Perhaps  most  important from the user's perspective; they do not need to
  enter  a username or password if their workstation is a member of an NTLM
  domain.  The  password  hashes  generated  when  they  logged on to their
  workstation  will be negotiated during the initial request for a session,
  passed through jCIFS, and validated against a PDC or BDC. This also makes
  the  user's domain, username, and password available for managing session
  information, profiles, preferences, etc. 

o The  functionality used to authenticate and manage arbitrary creadentials
  has   been  exposed  in  the  SmbSession  and  NtlmPasswordAuthentication
  classes.  This permits NTLM password authentication to be integrated into
  applications without requiring Microsoft components or JNI.

o With  the  introduction  of the jcifs.encoding property the client is now
  truely  internationalized.  It  has been used successfully on OS/390 with
  native  EBCDIC  character  encoding.  See the Sun JRE documentation for a
  list of supported encodings.

o The  URL  issues  remaining  in  the 0.6 series have been fixed in 0.7 by
  converting  all SMB URL handling internally to use the java.net.URL class
  (Note:  directories  must  now  have  a  trailing  slash  and Java 1.3 is
  required).  Also  a  deadlock in the name service code was identified and
  fixed (repaired in 0.6.8 as well).

o A  copyTo() method has been added to SmbFile that is very fast at copying
  large directories across hosts.

o There  have  been  numerous  other  changes  including  the  mkdirs() and
  getType() methods, plain text password support (disabled by default), the
  available()  method and close() fix for Named Pipes, reading files larger
  than 4 GB, the NtlmAuthenticator class, and more.

All documentation has been completely reviewed and updated. 

--8<--

                               jCIFS
           Common Internet File System Client in 100% Java
                      http://jcifs.samba.org


This  is  the  jCIFS  SMB client library written in Java. In short, it will
enable  Java applications to remotely access shared directories on SMB file
servers(i.e.  a  Microsoft  Windows  "share").  It  is  a  fairly religious
implementation  of  the  CIFS  specification  supporting Unicode, batching,
multiplexing,   encrypted   authentication,   transactions,   named  pipes,
domain/workgroup/server/share/directory/file enumeration, RAPs and more. It
is   licensed   under   LGPL   which  means  commercial  organizations  can
legitimately  use  it  with their propertietary code (you just can't modify
the  library  itself without providing the source for those changes to it's
users, see the LGPL for details).

REQUIREMENTS:

Java 1.3 or above - http://java.sun.com/products/

INSTALLATION:

Just  add  the  jar  file to you classpath as you would with any other jar.
More specifically:

UNIX:

Go  to  http://jcifs.samba.org and download the latest jar. If you download
the  tgz archive you also get the source code and javadoc API documentation
(see  critical properties discussed on the Overview page). Put it someplace
reasonable and extract it. For example: 

  $ gunzip jcifs-0.7.0.tgz
  $ tar -xvf jcifs-0.7.0.tar

Add  the  jar  to  your classpath. There are two ways to do this. One is to
explicitly set it on the command line when you run your application like:

  $ java -cp myjars/jcifs-0.7.0.jar MyApplication

but  a  more  robust  solution  is  to  export  it  in  your  ~/.profile or
~/.bash_profile like: 

  CLASSPATH=$CLASSPATH:/home/produser/myapp/myjars/jcifs-0.7.0.jar
  export CLASSPATH

WINDOWS:

Go  to  http://jcifs.samba.org and download the latest jar. If you download
the  zip archive you also get the source code and javadoc API documentation
(see  critical properties discussed on the Overview page). Put it someplace
reasonable and extract it with something like Winzip.

Add  the  jar  to  your classpath. There are two ways to do this. One is to
explicitly set it on the command line when you run your application like:

  C:\> java -cp myjars\jcifs-0.7.0.jar MyApplication

but  a  more robust solution would be to change your system environment but
I'm not confident I can tell you accurately how to do that.

It  is  also  common  that  the CLASSPATH be specified in a shell script or
batch file. See the build.bat batch file that runs the Ant build tool as an
example.

USING JCIFS:

In  general  the  public  API  is  extremely simple. The jcifs.smb.SmbFile,
jcifs.smb.SmbFileInputStream, and jcifs.smb.SmbFileOutputStream classes are
analogous     to    the    java.io.File,    java.io.FileInputStream,    and
java.io.FileOutputStream  classes so if you know how to use those it should
be  obvious how to use jCIFS provided you set any necessary properties(such
as WINS) and understand the smb:// URL syntax.

Here's an example to retrieve a file: 

  import jcifs.smb.*;

  jcifs.Config.setProperty( "wins", "192.168.1.230" );
  SmbFileInputStream in = new SmbFileInputStream(
       "smb://username:password@host/c/My Documents/report.txt" );
  byte[] b = new byte[8192];
  int n;
  while(( n = in.read( b )) > 0 ) {
      System.out.write( b, 0, n );
  }

You can also write, rename, list contents of a directory, enumerate shares,
communicate with Win32 Named Pipe Servers, ...etc.

The  protocol  handler  for  java.net.URL  is also in place which means you
retrieve  files  using the URL class as you would with other protocols. For
example: 

  jcifs.Config.registerSmbURLHandler(); //ensure protocol handler is loaded
  URL url = new URL( "smb://user:pass@host/share/dir/file.doc" );
  InputStream in = url.openStream();

There  are many example programs in the jcifs_0.7.0/examples/ directory. To
execute the Put example you might do: 

  $ java -cp examples:jcifs-0.7.0.jar -Djcifs.properties=jcifs.prp \
                  Put smb://usr:pass@host/share/dir/file.doc
  ##########
  582K transfered

This  will  also work with whatever else uses the URL class internally. For
example  if you use RMI you can serve class files from an SMB share and use
the codebase property:

  -Djava.rmi.server.codebase=smb://mymachine/c/download/myapp.jar

See the extensive API documentation included in the distribution.

BUILDING JCIFS FROM SOURCE:

If  you  wish  to  modify and/or build the jCIFS source simply download the
ant.tgz  or  ant.zip  available at http://jcifs.samba.org and extract it in
the   jcifs_0.7.0  directory.  Edit  the  build.sh  or  build.bat  file  to
appropriately  reflect the location of the JDK on your system and bootstrap
the Ant build tool. Now type:

  $ ./build.sh

You  will be presented with a list of target arguments. The build file is a
standard Ant build.xml config. You may also integrate the package into your
existing Ant installation or get the latest version of Ant here:

   http://jakarta.apache.org/ant/

WHAT IS SMB AND CIFS?

Server  Message Block (SMB) is an application layer networking protocol for
file  and  print  sharing.  It  is  the  de-facto  networking  protocol for
Microsoft  Windows platforms. The Common Internet File System (CIFS) is the
more  generic  name  for  all  that  encompasses  the protocol and its many
layers.  Collectively  this  is  the networking protocol used when you "Map
Network Drive...", issue "net use * \\server\share" commands, use smbclient
on  UNIX,  smbfs  on  Linux,  Sharity,  OS2, server vendors such as Network
Appliance, EMC, and Novell NetWare.

WHY DO YOU NEED JCIFS?

This  client  is  100%  Java  and  will  work  the  same  in  a  variety of
environments  from  Palm Pilots and applets to any UNIX that supports Java.
Naturally  you  can  choose  to  run  your  applications on a platform that
supports  mapping  or mounting remote volumes into the local filesystem but
this  assumes  you  know  what shares you are accessing in advance and what
platform your application is running on(do you use /mnt/pnt or H:\dir). The
latency involed makes this approach unsatisfactory for certain applications
(e.g.  Web Gateway). Using locally mapped filesystems is also not portable,
unstable due to unnecessary dependencies, and more difficult to manage. The
JCIFS  infrastructure  is  also  highly extensible. If there is a demand it
will include a great deal of additional functionality not available through
a filesystem API such as printing, RPC, NT file change notification, etc.

ACKNOWLEDGEMENTS

Special  thanks  to  the  Samba  organization and Christopher R. Hertel for
starting the JCIFS project. 

