commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From adammurd...@apache.org
Subject cvs commit: jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider/zip ZipFileObject.java ZipFileSystem.java
Date Sun, 20 Oct 2002 03:14:06 GMT
adammurdoch    2002/10/19 20:14:05

  Modified:    vfs/src/java/org/apache/commons/vfs/provider
                        AbstractFileObject.java
               vfs/src/java/org/apache/commons/vfs/provider/zip
                        ZipFileObject.java ZipFileSystem.java
  Log:
  - The root of a Zip/Jar file system is now treated as a folder.
  - getParent() on the root of a layered file system returns the parent
    of the parent layer.
  
  Patch submitted by David Bernard.
  
  Revision  Changes    Path
  1.8       +9 -2      jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider/AbstractFileObject.java
  
  Index: AbstractFileObject.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider/AbstractFileObject.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- AbstractFileObject.java	22 Aug 2002 02:42:45 -0000	1.7
  +++ AbstractFileObject.java	20 Oct 2002 03:14:05 -0000	1.8
  @@ -339,8 +339,15 @@
       {
           if ( this == fs.getRoot() )
           {
  -            // Root file has no parent
  -            return null;
  +            if (fs.getParentLayer() != null)
  +            {
  +                return fs.getParentLayer().getParent();
  +            }
  +            else
  +            {
  +                // Root file has no parent
  +                return null;
  +            }
           }
   
           // Locate the parent of this file
  
  
  
  1.4       +10 -3     jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider/zip/ZipFileObject.java
  
  Index: ZipFileObject.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider/zip/ZipFileObject.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ZipFileObject.java	22 Aug 2002 01:32:49 -0000	1.3
  +++ ZipFileObject.java	20 Oct 2002 03:14:05 -0000	1.4
  @@ -45,17 +45,24 @@
           }
       }
   
  -    protected void setZipEntry( ZipEntry entry )
  +    /**
  +     * Sets the details for this file object.
  +     */
  +    protected void setZipEntry( final ZipEntry entry )
       {
  -        if ( entry == null || this.entry != null )
  +        if ( this.entry != null )
           {
               return;
           }
             
  -        if ( entry.isDirectory() )
  +        if ( entry == null || entry.isDirectory() )
  +        {
               type = FileType.FOLDER;
  +        }
           else
  +        {
               type = FileType.FILE;
  +        }
   
           this.entry = entry;
       }
  
  
  
  1.9       +1 -1      jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider/zip/ZipFileSystem.java
  
  Index: ZipFileSystem.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider/zip/ZipFileSystem.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- ZipFileSystem.java	22 Aug 2002 02:42:46 -0000	1.8
  +++ ZipFileSystem.java	20 Oct 2002 03:14:05 -0000	1.9
  @@ -90,7 +90,7 @@
                   parent = (ZipFileObject) getFile( parentName );
                   if ( parent == null )
                   {
  -                    parent = createZipFileObject( parentName, null, null );
  +                    parent = createZipFileObject( parentName, null, zipFile );
                       putFile( parent );
                   }
   
  
  
  

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message