jcifs-0.8.2 from tgz
authorFelix Schumacher <p0354740@isib001.(none)>
Wed, 6 Aug 2008 14:15:24 +0000 (16:15 +0200)
committerFelix Schumacher <p0354740@isib001.(none)>
Wed, 6 Aug 2008 14:15:24 +0000 (16:15 +0200)
Sun Mar 14 18:54:14 EST 2004
jcifs-0.8.2 released

The DST adjustement used may not be correct. It has been commented out. The
problem regarding SmbFile.getParent has been fixed.

CHANGES.txt
README.txt
build.xml
examples/FileInfo.java
src/jcifs/smb/ServerMessageBlock.java
src/jcifs/smb/SmbFile.java

index c3786cc..41a8cc0 100644 (file)
@@ -1,3 +1,9 @@
+Sun Mar 14 18:54:14 EST 2004
+jcifs-0.8.2 released
+
+The DST adjustement used may not be correct. It has been commented out. The
+problem regarding SmbFile.getParent has been fixed. 
+
 Thu Feb 26 19:26:14 EST 2004
 jcifs-0.8.1 released
 
index 53b2e4f..9136262 100644 (file)
@@ -1,3 +1,9 @@
+Sun Mar 14 18:54:14 EST 2004
+jcifs-0.8.2 released
+
+The DST adjustement used may not be correct. It has been commented out. The
+problem regarding SmbFile.getParent has been fixed. 
+
 Thu Feb 26 19:26:14 EST 2004
 jcifs-0.8.1 released
 
index 21634c1..08af8b4 100644 (file)
--- a/build.xml
+++ b/build.xml
        <target name="jar" depends="smb">
                <copy file="src/jcifs/util/mime.map" tofile="build/jcifs/util/mime.map" overwrite="yes"/>
                <copy file="src/jcifs/http/ne.css" tofile="build/jcifs/http/ne.css" overwrite="yes"/>
-               <jar jarfile="jcifs-0.8.1.jar" basedir="build"/>
+               <jar jarfile="jcifs-0.8.2.jar" basedir="build"/>
        </target>
 
        <target name="tgz">
-               <copy todir="dist_tmp/jcifs_0.8.1">
+               <copy todir="dist_tmp/jcifs_0.8.2">
                        <fileset dir="." excludes="ant,**/.*,build,jcifs.prp,**/*.tgz,**/*.zip"/>
                </copy>
-               <tar tarfile="jcifs-0.8.1.tar" basedir="dist_tmp"/>
-               <gzip src="jcifs-0.8.1.tar" zipfile="jcifs-0.8.1.tgz"/>
-               <delete file="jcifs-0.8.1.tar"/>
+               <tar tarfile="jcifs-0.8.2.tar" basedir="dist_tmp"/>
+               <gzip src="jcifs-0.8.2.tar" zipfile="jcifs-0.8.2.tgz"/>
+               <delete file="jcifs-0.8.2.tar"/>
                <delete dir="dist_tmp"/>
        </target>
        <target name="zip">
-               <copy todir="dist_tmp/jcifs_0.8.1">
+               <copy todir="dist_tmp/jcifs_0.8.2">
                        <fileset dir="." excludes="ant,**/.*,build,jcifs.prp,**/*.tgz,**/*.zip"/>
                </copy>
                <fixcrlf srcdir="dist_tmp" cr="add" tab="remove" tablength="4" excludes="**/*.jar,**/*.exe"/>
-               <zip zipfile="jcifs-0.8.1.zip" basedir="dist_tmp"/>
+               <zip zipfile="jcifs-0.8.2.zip" basedir="dist_tmp"/>
                <delete dir="dist_tmp"/>
        </target>
 
index d9501ef..bfc9bfb 100644 (file)
@@ -5,15 +5,24 @@ import jcifs.smb.SmbFile;
 
 public class FileInfo {
 
-       static final String TYPES[] = {
-               "TYPE_COMM",
-               "TYPE_FILESYSTEM",
-               "TYPE_NAMED_PIPE",
-               "TYPE_PRINTER",
-               "TYPE_SERVER",
-               "TYPE_SHARE",
-               "TYPE_WORKGROUP"
-       };
+       static String getTypeName(int type) {
+               switch( type ) {
+                       case SmbFile.TYPE_FILESYSTEM:
+                               return "TYPE_FILESYSTEM";
+                       case SmbFile.TYPE_WORKGROUP:
+                               return "TYPE_WORKGROUP";
+                       case SmbFile.TYPE_SERVER:
+                               return "TYPE_SERVER";
+                       case SmbFile.TYPE_SHARE:
+                               return "TYPE_SHARE";
+                       case SmbFile.TYPE_NAMED_PIPE:
+                               return "TYPE_NAMED_PIPE";
+                       case SmbFile.TYPE_PRINTER:
+                               return "TYPE_PRINTER";
+                       default:
+                               return "UNKNOWN: " + type;
+               }
+       }
 
        public static void main( String argv[] ) throws Exception {
                int i, start, end;;
@@ -70,7 +79,7 @@ public class FileInfo {
                                        System.out.println( "      getUncPath: " + f.getUncPath() );
                                        break;
                                case 10:
-                                       System.out.println( "         getType: " + TYPES[f.getType()] );
+                                       System.out.println( "         getType: " + getTypeName(f.getType()));
                                        break;
                                case 11:
                                        System.out.println( "        getShare: " + f.getShare() );
index bf4d345..af11198 100644 (file)
@@ -155,6 +155,7 @@ abstract class ServerMessageBlock {
                long t = ((long)hi << 32 ) | ( (long)low & 0xFFFFFFFFL );
                t = ( t / 10000L - MILLISECONDS_BETWEEN_1970_AND_1601 );
 
+/*
                synchronized( TZ ) {
                        if( TZ.inDaylightTime( new Date() )) {
                                // in DST
@@ -174,9 +175,12 @@ abstract class ServerMessageBlock {
                                return t;
                        }
                }
+*/
+               return t;
        }
        static void writeTime( long t, byte[] dst, int dstIndex ) {
 
+/*
                if( t != 0L ) {
                        synchronized( TZ ) {
                                if( TZ.inDaylightTime( new Date() )) {
@@ -200,6 +204,7 @@ abstract class ServerMessageBlock {
 
                        t = (t + MILLISECONDS_BETWEEN_1970_AND_1601) * 10000L;
                }
+*/
 
                writeLong( t, dst, dstIndex );
        }
index ceb6a4a..0920ef4 100644 (file)
@@ -794,24 +794,31 @@ The <tt>shareAccess</tt> parameter controls what permissions other clients have
  */
 
        public String getParent() {
-               StringBuffer sb = new StringBuffer( "smb://" );
                String str = url.getAuthority();
+
                if( str.length() > 0 ) {
+                       StringBuffer sb = new StringBuffer( "smb://" );
+
                        sb.append( str );
-                       sb.append( '/' );
-               }
-               getUncPath0();
-               if( canon.length() > 1 ) {
-                       int i = canon.length() - 2;
-                       while( canon.charAt( i ) != '/' ) {
-                               i--;
-                       }
-                       if( i > 1 ) {
-                               sb.append( canon.substring( 1, i ));
+
+                       getUncPath0();
+                       if( canon.length() > 1 ) {
+                               sb.append( canon );
+                       } else {
                                sb.append( '/' );
                        }
+
+                       str = sb.toString();
+
+                       int i = str.length() - 2;
+                       while( str.charAt( i ) != '/' ) {
+                               i--;
+                       }
+
+                       return str.substring( 0, i + 1 );
                }
-               return sb.toString();
+
+               return "smb://";
        }
 
 /**