JCIFS

The Java CIFS Client Library

JCIFS is an Open Source client library that implements the CIFS/SMB networking protocol in 100% Java. CIFS is the standard file sharing protocol on the Microsoft Windows platform (e.g. Map Network Drive ...). This client is used extensively in production on large Intranets.

Links

Download
JCIFS NTLM HTTP Authentication
The FAQ
Mailing List Archive (GMANE)
Obtaining a Network Packet Capture

Developer Information

JCIFS API Documentation
Setting Client Properties
Setting Name Resolution Properties
Using JCIFS to Connect to Win32 Named Pipes
JCIFS Exceptions and NtlmAuthenticator
Using JCIFS NTLM Authentication for HTTP Connections
JCIFS is Licensed Under the LGPL

Related Java Projects

sharehound - CIFS network search engine
IntegraTUM WebDisk - HTTP to CIFS gateway
jcifs-ext - JCIFS Extensions
Jarapac - DCE/RPC in Java
The Jacob Project - Java/COM Bridge
JNBridge - Java/.NET Bridge
J-Integra - DCE/RPC in Java
Davenport - WebDAV to CIFS gateway
Starlasoft's JLAN Client and Server

CIFS Authorities

http://www.samba.org/
http://www.samba-tng.org/

Other CIFS Utilities and Tools

Samba for Amiga
Sharity-Lite
SMB Browse for MacOSX
Xamba Network Integration Project

MSRPC

Rpcdump utility for querying RPC servers
OpenGroup DCE/RPC Specification
OpenGroup DCE/RPC Specification - NDR
What OLE Is Really About

Kerberos

RFC1510 - Kerberos V5 Specification
How a Kerberos Logon Works in Win2K
JGSS Example
Kerberos Explained
W2K PAC Specification

Technical Documentation

"Implementing CIFS" (complete online book)
Annotated CIFS Specification: draft-leach-cifs-v1-spec-02.html
SNIA CIFS Technical Reference (V1.0)
The NTLM Authentication Protocol
A .NET Developer's Guide to Windows Security
Windows System Error Codes
Windows Network Management Error Codes
rfc1001 - NetBIOS Concepts and Methods
rfc1002 - NetBIOS Detailed Specifications
CIFS Explained (A whitepaper by John Kleven)
SMB URL draft specification V07
NetBIOS, NetBEUI, NBF, SMB, CIFS networking links page
Microsoft Writeup on WINS behavior
Microsoft Writeup on WINS under W2K
Microsoft Server Documentation on Browsing WANs using WINS
Windows IT Library: NT Network Plumbing
Thursby Software's CIFS pages
Linux Mag: Understanding the Network Neighborhood

Other

Join the JCIFS Mailing List
Browse the Source
Batching
GNU Library General Public License
http://www.gnu.org/
http://www.opensource.org/
Microsoft's CIFS Mailing List Archives

News

jcifs-1.2.9 released / Java 1.5 Issue, jcifs.encoding Documentation
posted by Mike, Apr 4, 2006
The 1.2.8 release was compiled with Java 1.5.0_06 which under certain conditions could cause the following error: java.lang.LinkageError: ... Unsupported major.minor version 49.0. I have rebuilt the entire package using the compiler I used previously (1.4.2_08). Also, the documentation regarding the jcifs.encoding property has been updated to clarify the implications of using a non-Internationalized version of the Java runtime.

jcifs-1.2.8 released / Deadlock Fix, ACLs, DFS, NTLM HTTP Filter, and More
posted by Mike, Mar 24, 2006
There are several significant changes in this release. These include:
  • A deadlock could occur if the client tried to logoff and logon at the same instant. This has been fixed.
  • It was discovered that in at least some cases "preauthentication" did not work properly. A very simple logical error would cause the wrong signing digest to be installed. This has been fixed.
  • The ACL patch has been integrated. The SmbFile.getSecurity() method is now available.
  • The jcifs.smb.client.responseTimeout and jcifs.smb.client.soTimeout values have been increased from 10000ms and 15000ms to 30000ms and 35000ms respectively. Users with crawler type applications will almost certainly want to reduce these values.
  • Several logical errors in DFS referral handling have been fixed (still no fix for the mystery preemtive behavior observed by Windows clients).
  • Documentation has been updated significantly.

jcifs-1.2.7 released / Transport Error, Filter Changes, Integer Overflow, User Contributed Patches, and More
posted by Mike, Nov 18, 2005
This release consists of the following changes. Happy Thanksgiving.
  • Some debugging printlns left over from the last release have been removed.
  • Added setContentLength(0) to two other places for the NTLM HTTP Filter. This is required for HTTP 1.0 clients (e.g. Google appliance servers).
  • The name service code will now properly resolve DNS names that begin with digits.
  • Several instances of possible integer overflow have been fixed.
  • A patch for large read and write support has been added to the patches directory. A patch for reading security descriptors has been added to the patches directory.
  • If a transport was in error due to a connection timeout it could remain in the error state indefinitely. This issue has been fixed.

jcifs-1.2.6 released / Session Management and Filter Fix
posted by Mike, Oct 7, 2005
It was discovered that redundant sessions could be created. This problem has been fixed but the fix is to simply not remove sessions from the list of sessions for a transport which is a waste of memory after time (although most users should not case as the number of sessions is proportional to the number of distinct credentials used). This will probably need to be revisited in the future. It has been advised that the Filter should call setStatus() before setContentLength(0). This change has been implemented.

jcifs-1.2.0 released / New Transport Layer, Port 445, getDiskFreeSpace
posted by Mike, May 22, 2005
The transport layer (the code that multiplexes requests from muliple threads over sockets) has occasionally caused trouble over the years. In general it was too complex. To remedy this problem the transport was rewritten and a forked 1.1.19 was released as the "trans" branch. This branch appears to be at stable enough that it is being released as 1.2.

The biggest change in this release should not be visible to users (hopefully) although some new features have managed to sneak in as a result of this merger. These new features are:
  • The client will now attempt to connect to port 445 as opposed to port 139. If this connection fails the client will fall-back to port 139.
  • If a share was disabled while jCIFS was connected an error would occur even if the share was reenabled before the client tried to access it. This has been fixed so that the client will reconnect and complete the current operation transparently.
  • The getDiskFreeSpace() method could report the wrong value for very large volumes. This has been fixed by adding a new info-level.
  • Named pipes were broken by changes for DCE/RPC transactions. They have been repaired.
  • The NetBIOS name resolution code will now use the last resource record in a name query response rather than the first. This appears to be more correct (at least with WMWare adapters on my XP workstation).
  • The client is generally faster because the transport is simpler. The amount of code for the transport is less than half of what it used to be.
Developers writing Java network clients may want to look at the jcifs.util.transport.* classes.

jcifs-1.1.11 released / File Corruption Bugfix
posted by Mike, May 4, 2005
If a file is opened with SmbFileOutputStream, written to, and then the client waits for jcifs.smb.client.soTimeout without any communication to the target, a subsequent write could zero the contents of the file before the current file index resulting in file corruption. This problem has been fixed. And alternative to upgrading is to use RandomAccessFile which does not have this problem.

Also in the download area is the "trans" release. This version has a completely rewritten transport layer, proper port 445+139 support as well as the beginnings of new features destined for 2.0. Use with caution - it's green.