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 ZipFileSystemProvider.java
Date Sat, 23 Nov 2002 00:05:27 GMT
adammurdoch    2002/11/22 16:05:27

  Modified:    vfs/src/java/org/apache/commons/vfs FileName.java
               vfs/src/java/org/apache/commons/vfs/impl
                        VirtualFileProvider.java
               vfs/src/java/org/apache/commons/vfs/provider/ftp
                        FtpFileSystemProvider.java
               vfs/src/java/org/apache/commons/vfs/provider/jar
                        JarFileSystemProvider.java
               vfs/src/java/org/apache/commons/vfs/provider/local
                        DefaultLocalFileSystemProvider.java
               vfs/src/java/org/apache/commons/vfs/provider/smb
                        SmbFileSystemProvider.java
               vfs/src/java/org/apache/commons/vfs/provider/temp
                        TemporaryFileProvider.java
               vfs/src/java/org/apache/commons/vfs/provider/url
                        UrlFileProvider.java
               vfs/src/java/org/apache/commons/vfs/provider/zip
                        ZipFileSystemProvider.java
  Log:
  Replace hardcoded "/" root file path with constant.
  
  Revision  Changes    Path
  1.7       +5 -0      jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/FileName.java
  
  Index: FileName.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/FileName.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- FileName.java	31 Oct 2002 10:30:44 -0000	1.6
  +++ FileName.java	23 Nov 2002 00:05:26 -0000	1.7
  @@ -67,6 +67,11 @@
   public interface FileName
   {
       /**
  +     * The absolute path of the root of a file system.
  +     */
  +    String ROOT_PATH = "/";
  +
  +    /**
        * Returns the base name of this file.  The base name is the last element
        * of the file name.  For example the base name of
        * <code>/somefolder/somefile</code> is <code>somefile</code>.
  
  
  
  1.2       +4 -4      jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/impl/VirtualFileProvider.java
  
  Index: VirtualFileProvider.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/impl/VirtualFileProvider.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- VirtualFileProvider.java	1 Nov 2002 03:27:30 -0000	1.1
  +++ VirtualFileProvider.java	23 Nov 2002 00:05:26 -0000	1.2
  @@ -80,10 +80,10 @@
       public FileObject createFileSystem( final FileObject rootFile )
           throws FileSystemException
       {
  -        final FileName rootName = new DefaultFileName( parser, rootFile.getName().getURI(),
"/" );
  +        final FileName rootName = new DefaultFileName( parser, rootFile.getName().getURI(),
FileName.ROOT_PATH );
           final VirtualFileSystem fs = new VirtualFileSystem( rootName );
           addComponent( fs );
  -        fs.addJunction( rootName, rootFile );
  +        fs.addJunction( FileName.ROOT_PATH, rootFile );
           return fs.getRoot();
       }
   
  @@ -92,7 +92,7 @@
        */
       public FileObject createFileSystem( final String rootUri ) throws FileSystemException
       {
  -        final FileName rootName = new DefaultFileName( parser, rootUri, "/" );
  +        final FileName rootName = new DefaultFileName( parser, rootUri, FileName.ROOT_PATH
);
           final VirtualFileSystem fs = new VirtualFileSystem( rootName );
           addComponent( fs );
           return fs.getRoot();
  
  
  
  1.8       +1 -1      jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider/ftp/FtpFileSystemProvider.java
  
  Index: FtpFileSystemProvider.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider/ftp/FtpFileSystemProvider.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- FtpFileSystemProvider.java	31 Oct 2002 10:40:57 -0000	1.7
  +++ FtpFileSystemProvider.java	23 Nov 2002 00:05:26 -0000	1.8
  @@ -91,7 +91,7 @@
           final FtpUri ftpUri = (FtpUri)uri;
   
           // Build the root name
  -        final FileName rootName = new DefaultFileName( parser, ftpUri.getContainerUri(),
"/" );
  +        final FileName rootName = new DefaultFileName( parser, ftpUri.getContainerUri(),
FileName.ROOT_PATH );
   
           // Determine the username and password to use
           String username = ftpUri.getUserName();
  
  
  
  1.6       +3 -2      jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider/jar/JarFileSystemProvider.java
  
  Index: JarFileSystemProvider.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider/jar/JarFileSystemProvider.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- JarFileSystemProvider.java	28 Oct 2002 02:05:06 -0000	1.5
  +++ JarFileSystemProvider.java	23 Nov 2002 00:05:26 -0000	1.6
  @@ -58,6 +58,7 @@
   import org.apache.commons.vfs.FileObject;
   import org.apache.commons.vfs.FileSystem;
   import org.apache.commons.vfs.FileSystemException;
  +import org.apache.commons.vfs.FileName;
   import org.apache.commons.vfs.provider.DefaultFileName;
   import org.apache.commons.vfs.provider.zip.ZipFileSystemProvider;
   
  @@ -84,7 +85,7 @@
           throws FileSystemException
       {
           final String rootUri = getParser().buildRootUri( scheme, file.getName().getURI()
);
  -        final DefaultFileName name = new DefaultFileName( getParser(), rootUri, "/" );
  +        final DefaultFileName name = new DefaultFileName( getParser(), rootUri, FileName.ROOT_PATH
);
           return new JarFileSystem( name, file );
       }
   }
  
  
  
  1.10      +2 -1      jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider/local/DefaultLocalFileSystemProvider.java
  
  Index: DefaultLocalFileSystemProvider.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider/local/DefaultLocalFileSystemProvider.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- DefaultLocalFileSystemProvider.java	31 Oct 2002 10:40:57 -0000	1.9
  +++ DefaultLocalFileSystemProvider.java	23 Nov 2002 00:05:26 -0000	1.10
  @@ -59,6 +59,7 @@
   import org.apache.commons.vfs.FileObject;
   import org.apache.commons.vfs.FileSystem;
   import org.apache.commons.vfs.FileSystemException;
  +import org.apache.commons.vfs.FileName;
   import org.apache.commons.vfs.provider.AbstractOriginatingFileProvider;
   import org.apache.commons.vfs.provider.DefaultFileName;
   import org.apache.commons.vfs.provider.LocalFileProvider;
  @@ -143,7 +144,7 @@
           final String rootFile = fileUri.getRootFile();
   
           // Create the file system
  -        final DefaultFileName rootName = new DefaultFileName( parser, fileUri.getContainerUri(),
"/" );
  +        final DefaultFileName rootName = new DefaultFileName( parser, fileUri.getContainerUri(),
FileName.ROOT_PATH );
           return new LocalFileSystem( rootName, rootFile );
       }
   }
  
  
  
  1.8       +1 -1      jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider/smb/SmbFileSystemProvider.java
  
  Index: SmbFileSystemProvider.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider/smb/SmbFileSystemProvider.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- SmbFileSystemProvider.java	31 Oct 2002 10:40:57 -0000	1.7
  +++ SmbFileSystemProvider.java	23 Nov 2002 00:05:26 -0000	1.8
  @@ -91,7 +91,7 @@
           throws FileSystemException
       {
           final SmbUri smbUri = (SmbUri)uri;
  -        final FileName rootName = new DefaultFileName( parser, smbUri.getContainerUri(),
"/" );
  +        final FileName rootName = new DefaultFileName( parser, smbUri.getContainerUri(),
FileName.ROOT_PATH );
           return new SmbFileSystem( rootName );
       }
   }
  
  
  
  1.3       +2 -2      jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider/temp/TemporaryFileProvider.java
  
  Index: TemporaryFileProvider.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider/temp/TemporaryFileProvider.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TemporaryFileProvider.java	31 Oct 2002 10:40:58 -0000	1.2
  +++ TemporaryFileProvider.java	23 Nov 2002 00:05:27 -0000	1.3
  @@ -106,7 +106,7 @@
               {
                   rootFile = getContext().getTemporaryFileStore().allocateFile( "tempfs"
);
               }
  -            final FileName rootName = new DefaultFileName( parser, parsedUri.getContainerUri(),
"/" );
  +            final FileName rootName = new DefaultFileName( parser, parsedUri.getContainerUri(),
FileName.ROOT_PATH );
               filesystem = new LocalFileSystem( rootName, rootFile.getAbsolutePath() );
               addFileSystem( this, filesystem );
           }
  
  
  
  1.7       +3 -2      jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider/url/UrlFileProvider.java
  
  Index: UrlFileProvider.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider/url/UrlFileProvider.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- UrlFileProvider.java	31 Oct 2002 10:40:58 -0000	1.6
  +++ UrlFileProvider.java	23 Nov 2002 00:05:27 -0000	1.7
  @@ -57,6 +57,7 @@
   
   import org.apache.commons.vfs.FileSystem;
   import org.apache.commons.vfs.FileSystemException;
  +import org.apache.commons.vfs.FileName;
   import org.apache.commons.vfs.provider.AbstractOriginatingFileProvider;
   import org.apache.commons.vfs.provider.DefaultFileName;
   import org.apache.commons.vfs.provider.UriParser;
  @@ -88,7 +89,7 @@
       protected FileSystem doCreateFileSystem( final Uri uri )
           throws FileSystemException
       {
  -        final DefaultFileName rootName = new DefaultFileName( parser, uri.getContainerUri(),
"/" );
  +        final DefaultFileName rootName = new DefaultFileName( parser, uri.getContainerUri(),
FileName.ROOT_PATH );
           return new UrlFileSystem( rootName );
       }
   }
  
  
  
  1.13      +2 -1      jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider/zip/ZipFileSystemProvider.java
  
  Index: ZipFileSystemProvider.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider/zip/ZipFileSystemProvider.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- ZipFileSystemProvider.java	31 Oct 2002 10:40:58 -0000	1.12
  +++ ZipFileSystemProvider.java	23 Nov 2002 00:05:27 -0000	1.13
  @@ -58,6 +58,7 @@
   import org.apache.commons.vfs.FileObject;
   import org.apache.commons.vfs.FileSystem;
   import org.apache.commons.vfs.FileSystemException;
  +import org.apache.commons.vfs.FileName;
   import org.apache.commons.vfs.provider.AbstractLayeredFileProvider;
   import org.apache.commons.vfs.provider.DefaultFileName;
   import org.apache.commons.vfs.provider.FileProvider;
  @@ -97,7 +98,7 @@
           throws FileSystemException
       {
           final String rootUri = parser.buildRootUri( scheme, file.getName().getURI() );
  -        final DefaultFileName name = new DefaultFileName( parser, rootUri, "/" );
  +        final DefaultFileName name = new DefaultFileName( parser, rootUri, FileName.ROOT_PATH
);
           return new ZipFileSystem( name, file );
       }
   
  
  
  

--
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