jcifs-0.8.1 from tgz
authorFelix Schumacher <p0354740@isib001.(none)>
Wed, 6 Aug 2008 14:14:50 +0000 (16:14 +0200)
committerFelix Schumacher <p0354740@isib001.(none)>
Wed, 6 Aug 2008 14:14:50 +0000 (16:14 +0200)
Thu Feb 26 19:26:14 EST 2004
jcifs-0.8.1 released

The  decision  to  exclude ATTR_HIDDEN files in generic list operations has
been  revoked.  All  list methods now include all files unless specifically
filtered.

The following bugs have been fixed:

  o Previously querying the last modified time or file size immediately
        following    a    SmbFileOutputStream.write   call   returned   old
        information.
  o The createNewFile method did not use the correct open mode.
  o The setLastModified method set the create time to an invalid value.

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

index 0e6aafb..c3786cc 100644 (file)
@@ -1,3 +1,18 @@
+Thu Feb 26 19:26:14 EST 2004
+jcifs-0.8.1 released
+
+The  decision  to  exclude ATTR_HIDDEN files in generic list operations has
+been  revoked.  All  list methods now include all files unless specifically
+filtered.
+
+The following bugs have been fixed:
+
+  o Previously querying the last modified time or file size immediately
+       following    a    SmbFileOutputStream.write   call   returned   old
+       information.
+  o The createNewFile method did not use the correct open mode.
+  o The setLastModified method set the create time to an invalid value.
+
 Tue Feb 10 23:44:45 EST 2004
 jcifs-0.8.0 released
 
index fd30bf5..53b2e4f 100644 (file)
@@ -1,3 +1,15 @@
+Thu Feb 26 19:26:14 EST 2004
+jcifs-0.8.1 released
+
+Hidden  files  are  included  in  all  list  operations unless specifically
+filtered.  A  attribute  caching bug, createNewFile open mode bug, and time
+setting method bugs have been fixed. 
+
+Tue Feb 10 23:44:45 EST 2004
+jcifs-0.8.0 released
+
+This completes the 0.8 beta cycle. There is no technical difference between
+this release and 0.8.0b1. 
 Tue Feb 10 23:44:45 EST 2004
 jcifs-0.8.0 released
 
index b0ed45e..21634c1 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.0.jar" basedir="build"/>
+               <jar jarfile="jcifs-0.8.1.jar" basedir="build"/>
        </target>
 
        <target name="tgz">
-               <copy todir="dist_tmp/jcifs_0.8.0">
+               <copy todir="dist_tmp/jcifs_0.8.1">
                        <fileset dir="." excludes="ant,**/.*,build,jcifs.prp,**/*.tgz,**/*.zip"/>
                </copy>
-               <tar tarfile="jcifs-0.8.0.tar" basedir="dist_tmp"/>
-               <gzip src="jcifs-0.8.0.tar" zipfile="jcifs-0.8.0.tgz"/>
-               <delete file="jcifs-0.8.0.tar"/>
+               <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"/>
                <delete dir="dist_tmp"/>
        </target>
        <target name="zip">
-               <copy todir="dist_tmp/jcifs_0.8.0">
+               <copy todir="dist_tmp/jcifs_0.8.1">
                        <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.0.zip" basedir="dist_tmp"/>
+               <zip zipfile="jcifs-0.8.1.zip" basedir="dist_tmp"/>
                <delete dir="dist_tmp"/>
        </target>
 
index 07985f7..009e210 100644 (file)
@@ -5,7 +5,6 @@ public class Exists {
        public static void main( String argv[] ) throws Exception {
 
                SmbFile f = new SmbFile( argv[0] );
-               System.out.println( f.length() + " bytes" );
                if( f.exists() ) {
                        System.out.println( argv[0] + " exists" );
                } else {
index bb5f458..d9501ef 100644 (file)
@@ -85,7 +85,7 @@ public class FileInfo {
                                        System.out.println( "       getParent: " + f.getParent() );
                                        break;
                                case 15:
-                                       System.out.println( "    lastModified: " + sdf.format( new Date( f.lastModified() )));
+                                       System.out.println( "    lastModified: " + + f.lastModified() + ": " + sdf.format( new Date( f.lastModified() )));
                                        break;
                                case 16:
                                        System.out.println( "getDiskFreeSpace: " + f.getDiskFreeSpace() );
@@ -108,9 +108,12 @@ public class FileInfo {
                                case 22:
                                        System.out.println( "        canWrite: " + f.canWrite() );
                                        break;
+                               case 23:
+                                       System.out.println( "      createTime: " + + f.createTime() + ": " + sdf.format( new Date( f.createTime() )));
+                                       break;
                        }
                        i++;
-                       if( i == 23 ) {
+                       if( i == 24 ) {
                                i = 0;
                        }
                } while( i != end );
index ac92961..bf4d345 100644 (file)
@@ -177,27 +177,29 @@ abstract class ServerMessageBlock {
        }
        static void writeTime( long t, byte[] dst, int dstIndex ) {
 
-               synchronized( TZ ) {
-                       if( TZ.inDaylightTime( new Date() )) {
-                               // in DST
-                               if( TZ.inDaylightTime( new Date( t ))) {
-                                       // t also in DST so no correction
-                               } else {
-                                       // t not in DST so subtract 1 hour
-                                       t -= 3600000;
-                               }
-                       } else {
-                               // not in DST
-                               if( TZ.inDaylightTime( new Date( t ))) {
-                                       // t is in DST so add 1 hour
-                                       t += 3600000;
+               if( t != 0L ) {
+                       synchronized( TZ ) {
+                               if( TZ.inDaylightTime( new Date() )) {
+                                       // in DST
+                                       if( TZ.inDaylightTime( new Date( t ))) {
+                                               // t also in DST so no correction
+                                       } else {
+                                               // t not in DST so subtract 1 hour
+                                               t -= 3600000;
+                                       }
                                } else {
-                                       // t isn't in DST either
+                                       // not in DST
+                                       if( TZ.inDaylightTime( new Date( t ))) {
+                                               // t is in DST so add 1 hour
+                                               t += 3600000;
+                                       } else {
+                                               // t isn't in DST either
+                                       }
                                }
                        }
-               }
 
-               t = (t + MILLISECONDS_BETWEEN_1970_AND_1601) * 10000L;
+                       t = (t + MILLISECONDS_BETWEEN_1970_AND_1601) * 10000L;
+               }
 
                writeLong( t, dst, dstIndex );
        }
index a4a0761..ceb6a4a 100644 (file)
@@ -375,7 +375,6 @@ public class SmbFile extends URLConnection {
        SmbComBlankResponse blank_resp = new SmbComBlankResponse();
        DfsReferral dfsReferral = null;  // Only used by getDfsPath()
 
-
 /** 
  * Constructs an SmbFile representing a resource on an SMB network such as
  * a file or directory. See the description and examples of smb URLs above.
@@ -1098,7 +1097,7 @@ The <tt>shareAccess</tt> parameter controls what permissions other clients have
                try {
                        if( url.getHost().length() == 0 ) {
                        } else if( share == null ) {
-                               if( type == TYPE_WORKGROUP ) {
+                               if( getType() == TYPE_WORKGROUP ) {
                                        UniAddress.getByName( url.getHost(), true );
                                } else {
                                        UniAddress.getByName( url.getHost() ).getHostName();
@@ -1292,10 +1291,10 @@ The <tt>shareAccess</tt> parameter controls what permissions other clients have
  */
 
        public String[] list() throws SmbException {
-               return list( "*", ATTR_DIRECTORY | ATTR_SYSTEM, null, null );
+               return list( "*", ATTR_DIRECTORY | ATTR_HIDDEN | ATTR_SYSTEM, null, null );
        }
        public String[] list( SmbFilenameFilter filter ) throws SmbException {
-               return list( "*", ATTR_DIRECTORY | ATTR_SYSTEM, filter, null );
+               return list( "*", ATTR_DIRECTORY | ATTR_HIDDEN | ATTR_SYSTEM, filter, null );
        }
 
 /**
@@ -1325,7 +1324,7 @@ The <tt>shareAccess</tt> parameter controls what permissions other clients have
  */
 
        public SmbFile[] listFiles() throws SmbException {
-               return listFiles( "*", ATTR_DIRECTORY | ATTR_SYSTEM, null, null );
+               return listFiles( "*", ATTR_DIRECTORY | ATTR_HIDDEN | ATTR_SYSTEM, null, null );
        }
 
 /**
@@ -1358,13 +1357,13 @@ The <tt>shareAccess</tt> parameter controls what permissions other clients have
  */
 
        public SmbFile[] listFiles( String wildcard ) throws SmbException {
-               return listFiles( wildcard, ATTR_DIRECTORY | ATTR_SYSTEM, null, null );
+               return listFiles( wildcard, ATTR_DIRECTORY | ATTR_HIDDEN | ATTR_SYSTEM, null, null );
        }
        public SmbFile[] listFiles( SmbFilenameFilter filter ) throws SmbException {
-               return listFiles( "*", ATTR_DIRECTORY | ATTR_SYSTEM, filter, null );
+               return listFiles( "*", ATTR_DIRECTORY | ATTR_HIDDEN | ATTR_SYSTEM, filter, null );
        }
        public SmbFile[] listFiles( SmbFileFilter filter ) throws SmbException {
-               return listFiles( "*", ATTR_DIRECTORY | ATTR_SYSTEM, null, filter );
+               return listFiles( "*", ATTR_DIRECTORY | ATTR_HIDDEN | ATTR_SYSTEM, null, filter );
        }
        String[] list( String wildcard, int searchAttributes,
                                SmbFilenameFilter fnf, SmbFileFilter ff ) throws SmbException {
@@ -2018,7 +2017,7 @@ The <tt>shareAccess</tt> parameter controls what permissions other clients have
                        throw new SmbException( SmbException.ERRDOS,
                                                                        SmbException.ERRnoaccess );
                }
-               close( open0( O_RDWR | O_EXCL, ATTR_NORMAL, 0 ), 0L );
+               close( open0( O_RDWR | O_CREAT | O_EXCL, ATTR_NORMAL, 0 ), 0L );
        }
 
        void setPathInformation( int attrs, long ctime, long mtime ) throws SmbException {
index fb2e6a6..d0e1f89 100644 (file)
@@ -221,5 +221,7 @@ write, and/or delete the file while the jCIFS user has the file open.
                                file.send( req, rsp );\r
                        }\r
                } while( len > 0 );\r
+\r
+               file.attrExpiration = file.sizeExpiration = 0L;\r
        }\r
 }\r