jcifs-0.5.2 from tgz
authorFelix Schumacher <p0354740@isib001.(none)>
Wed, 6 Aug 2008 13:59:53 +0000 (15:59 +0200)
committerFelix Schumacher <p0354740@isib001.(none)>
Wed, 6 Aug 2008 13:59:53 +0000 (15:59 +0200)
commit2939c1e39922cd97362d96d624e8909aeced7a88
tree85df322b1ae92e8c4ba8a43db12cf66a40ff58f0
parent0c4a74deb8d9f329557b1ce5c220fa3916318dad
jcifs-0.5.2 from tgz

jcifs-0.5.2 from tgz

 There have been significant changes under the hood. The primitives such as packet encoding/decoding and transport have proven very sturdy however
 the top level glue and logic driving the client really needed an overhaul in hindsight. The client is much smarter now whereas previously jCIFS
 was quite chatty and used some messages abusively (NodeStatusRequest). Some other cleanups that took into account allocation of buffers and large
 numbers of objects have resulted in measureable performance improvements. All of this should be transparent to the user however my confidence in
 the stabilty of 0.5.1 no longer applies. It will take some time to confirm everything works as advertised. I am confident however that any bugs
 will only require minor adjustments to fix. Of course the name resolution bug that triggered this crusade has been fixed.

 There are some API changes. Most methods of SmbFile throw the now public SmbException. Natrually, this will require changes to existing code. For
 example, if your code was:

 if( r.delete() ) {
   System.out.println( "delete successfull" );
 } else {
   System.out.println( "error!" );
 }

 you might replace this with:

 try {
   f.delete();
   System.out.println( "delete successfull" );
 } catch( SmbException se ) {
   System.out.println( "error: " + se.getMessage() );
 }

 There are quite a few different messages that can be provoked such as:

 The file is being used by another process
 The device is not ready
 All pipe instances are busy
 ...

 not all of which have text messages (and which ones do have messages are in only English at the moment). You can test and make dicisions based on the
 errorClass and errorCode of an SmbException. All SmbExceptions are thrown through these methods unless an object implementing the AuthHandler
 interface has been called with the static SmbFile.setAuthHanler method. If an AuthHandler has been specified the following authentication related
 SmbExceptions:

 Access denied
 Bad password
 The client does not have the necessary access rights for the requested function
 The user account has expired
 The user is not allowed to access this server from this client
 The user is not permitted to access the server at this time
 The password of the user has expired

 will not be thrown by SmbFile methods but rather passed in the AuthInfo object to the AuthHandler's authenticate() method along with the username,
 password,
 domain, and target URL if one of these SmbExceptions occurs. See http://lists.samba.org/pipermail/jcifs/2001-October/001553.html for a related
 discussion. I
 believe this is a powerfull feature in itself. This provides for sophisticated error handling and consistent error messages (the messages are the
 same as those reported by Windows clients). There is also an oppurunity to introduce a ResourceBundle of text messages here. I beleive it will work
 quite well and in practice I do not believe code will be cluttered with try/catch.

 The NbtAddress class was designed to handle NetBIOS name queries similarly to the common InetAddress class. Unfortunately a lapse in judgment
 integrated DNS
 queries into this class in jcifs-0.5 (thus the name service bug). The solution is to remove this DNS code and provide a wrapper class that handles
 both DNS queries as well as NetBIOS queries mainly delegating the work to InetAddress and NbtAddress. This class is UniAddress. Here is how each of
 these classes should be used:

 o InetAddress - Lookup a DNS name
 o NbtAddress - Lookup a NetBIOS name or perform NetBIOS specific
     queries (NodeStatus with getAllByAddress)
 o UniAddress - Don't know or care what type of name it is, try to
     find the name with both DNS and NetBIOS queries if necessary. Query
     behavior is governed by the jcifs.resolveOrder property.

 So generally the UniAddress class should be used if you wish to interface
 with name services directly (normally not necessary when working with
 the jcifs.smb package).
56 files changed:
README.txt
build.xml
examples/AuthDialog.java [new file with mode: 0644]
examples/CrawlerBench.java [new file with mode: 0644]
examples/Delete.java
examples/Dns.java [new file with mode: 0644]
examples/FileOps.java
examples/GetURL.java
examples/IsDir.java [new file with mode: 0644]
examples/Length.java [new file with mode: 0644]
examples/List.java
examples/Mkdir.java
examples/ProcTest.java [new file with mode: 0644]
examples/Query.java
examples/RenameTo.java
examples/SmbShell.java
examples/TestSmbFile.java
examples/ThreadedSmbCrawler.java
examples/TortureTest5.java
src/jcifs/Config.java
src/jcifs/UniAddress.java [new file with mode: 0644]
src/jcifs/netbios/Lmhosts.java
src/jcifs/netbios/Log.java
src/jcifs/netbios/Name.java
src/jcifs/netbios/NameQueryResponse.java
src/jcifs/netbios/NameServiceClient.java
src/jcifs/netbios/NbtAddress.java
src/jcifs/netbios/NbtSocket.java
src/jcifs/netbios/NodeStatusRequest.java
src/jcifs/netbios/NodeStatusResponse.java
src/jcifs/netbios/SessionRequestPacket.java
src/jcifs/smb/AndXServerMessageBlock.java
src/jcifs/smb/BufferCache.java [new file with mode: 0644]
src/jcifs/smb/Handler.java
src/jcifs/smb/NetServerEnum2.java
src/jcifs/smb/NetServerEnum2Response.java
src/jcifs/smb/NetShareEnumResponse.java
src/jcifs/smb/ServerMessageBlock.java
src/jcifs/smb/SmbAuthException.java [new file with mode: 0644]
src/jcifs/smb/SmbComNTCreateAndX.java
src/jcifs/smb/SmbComTransaction.java
src/jcifs/smb/SmbComTransactionResponse.java
src/jcifs/smb/SmbComTreeConnectAndX.java
src/jcifs/smb/SmbException.java
src/jcifs/smb/SmbFile.java
src/jcifs/smb/SmbFileInputStream.java
src/jcifs/smb/SmbFileOutputStream.java
src/jcifs/smb/SmbSession.java
src/jcifs/smb/SmbTransport.java
src/jcifs/smb/SmbTree.java
src/jcifs/smb/SmbURL.java
src/jcifs/smb/SmbURLConnection.java
src/jcifs/smb/TransactNamedPipeOutputStream.java
src/jcifs/util/AuthHandler.java [new file with mode: 0644]
src/jcifs/util/AuthInfo.java [new file with mode: 0644]
src/jcifs/util/Config.java