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/test/org/apache/commons/vfs/test AbstractProviderTestCase.java
Date Mon, 17 Feb 2003 09:22:16 GMT
adammurdoch    2003/02/17 01:22:16

  Modified:    vfs/src/java/org/apache/commons/vfs/impl
                        StandardFileSystemManager.java
                        VirtualFileProvider.java
               vfs/src/java/org/apache/commons/vfs/provider
                        AbstractLayeredFileProvider.java
                        AbstractOriginatingFileProvider.java
                        BasicFileName.java GenericFileName.java
                        LayeredFileName.java
               vfs/src/java/org/apache/commons/vfs/provider/local
                        LocalFileName.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/test/org/apache/commons/vfs/provider/ftp/test
                        FtpProviderTestCase.java
               vfs/src/test/org/apache/commons/vfs/provider/jar/test
                        JarProviderTestCase.java NestedJarTestCase.java
               vfs/src/test/org/apache/commons/vfs/provider/smb/test
                        SmbProviderTestCase.java
               vfs/src/test/org/apache/commons/vfs/provider/url/test
                        UrlProviderTestCase.java
               vfs/src/test/org/apache/commons/vfs/provider/webdav/test
                        WebdavProviderTestCase.java
               vfs/src/test/org/apache/commons/vfs/provider/zip/test
                        NestedZipTestCase.java ZipProviderTestCase.java
               vfs/src/test/org/apache/commons/vfs/test
                        AbstractProviderTestCase.java
  Added:       vfs/src/java/org/apache/commons/vfs/provider
                        AbstractFileName.java AbstractFileProvider.java
               vfs/src/java/org/apache/commons/vfs/provider/ftp
                        FtpFileProvider.java
               vfs/src/java/org/apache/commons/vfs/provider/jar
                        JarFileProvider.java
               vfs/src/java/org/apache/commons/vfs/provider/local
                        DefaultLocalFileProvider.java
               vfs/src/java/org/apache/commons/vfs/provider/smb
                        SmbFileProvider.java
               vfs/src/java/org/apache/commons/vfs/provider/webdav
                        WebdavFileProvider.java
               vfs/src/java/org/apache/commons/vfs/provider/zip
                        ZipFileProvider.java
  Removed:     vfs/src/java/org/apache/commons/vfs/provider
                        AbstractFileSystemProvider.java
                        DefaultFileName.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/webdav
                        WebdavProvider.java
               vfs/src/java/org/apache/commons/vfs/provider/zip
                        ZipFileSystemProvider.java
  Log:
  - Renamed DefaultFileName to AbstractFileName.
  - Applied a consistent naming scheme to all the FileProvider implementations.
  
  Revision  Changes    Path
  1.10      +7 -7      jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/impl/StandardFileSystemManager.java
  
  Index: StandardFileSystemManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/impl/StandardFileSystemManager.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- StandardFileSystemManager.java	15 Feb 2003 00:17:06 -0000	1.9
  +++ StandardFileSystemManager.java	17 Feb 2003 09:22:14 -0000	1.10
  @@ -87,12 +87,12 @@
           setTemporaryFileStore( replicator );
   
           // Add the standard providers
  -        addProvider( "file", "org.apache.commons.vfs.provider.local.DefaultLocalFileSystemProvider" );
  -        addProvider( "zip", "org.apache.commons.vfs.provider.zip.ZipFileSystemProvider" );
  -        addProvider( "jar", "org.apache.commons.vfs.provider.jar.JarFileSystemProvider" );
  -        addProvider( "ftp", "org.apache.commons.vfs.provider.ftp.FtpFileSystemProvider" );
  -        addProvider( "smb", "org.apache.commons.vfs.provider.smb.SmbFileSystemProvider" );
  -        addProvider( "webdav", "org.apache.commons.vfs.provider.webdav.WebdavProvider" );
  +        addProvider( "file", "org.apache.commons.vfs.provider.local.DefaultLocalFileProvider" );
  +        addProvider( "zip", "org.apache.commons.vfs.provider.zip.ZipFileProvider" );
  +        addProvider( "jar", "org.apache.commons.vfs.provider.jar.JarFileProvider" );
  +        addProvider( "ftp", "org.apache.commons.vfs.provider.ftp.FtpFileProvider" );
  +        addProvider( "smb", "org.apache.commons.vfs.provider.smb.SmbFileProvider" );
  +        addProvider( "webdav", "org.apache.commons.vfs.provider.webdav.WebdavFileProvider" );
           addProvider( "tmp", "org.apache.commons.vfs.provider.temp.TemporaryFileProvider" );
   
           // Add a default provider
  
  
  
  1.6       +2 -2      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.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- VirtualFileProvider.java	12 Feb 2003 07:56:10 -0000	1.5
  +++ VirtualFileProvider.java	17 Feb 2003 09:22:14 -0000	1.6
  @@ -59,7 +59,7 @@
   import org.apache.commons.vfs.FileObject;
   import org.apache.commons.vfs.FileSystemException;
   import org.apache.commons.vfs.provider.AbstractVfsContainer;
  -import org.apache.commons.vfs.provider.DefaultFileName;
  +import org.apache.commons.vfs.provider.AbstractFileName;
   import org.apache.commons.vfs.provider.BasicFileName;
   
   
  
  
  
  1.9       +2 -2      jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider/AbstractLayeredFileProvider.java
  
  Index: AbstractLayeredFileProvider.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider/AbstractLayeredFileProvider.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- AbstractLayeredFileProvider.java	12 Feb 2003 07:56:13 -0000	1.8
  +++ AbstractLayeredFileProvider.java	17 Feb 2003 09:22:14 -0000	1.9
  @@ -68,7 +68,7 @@
    * @version $Revision$ $Date$
    */
   public abstract class AbstractLayeredFileProvider
  -    extends AbstractFileSystemProvider
  +    extends AbstractFileProvider
       implements FileProvider
   {
       /**
  
  
  
  1.12      +2 -2      jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider/AbstractOriginatingFileProvider.java
  
  Index: AbstractOriginatingFileProvider.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider/AbstractOriginatingFileProvider.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- AbstractOriginatingFileProvider.java	15 Feb 2003 00:07:45 -0000	1.11
  +++ AbstractOriginatingFileProvider.java	17 Feb 2003 09:22:14 -0000	1.12
  @@ -69,7 +69,7 @@
    * @version $Revision$ $Date$
    */
   public abstract class AbstractOriginatingFileProvider
  -    extends AbstractFileSystemProvider
  +    extends AbstractFileProvider
   {
       /**
        * Locates a file object, by absolute URI.
  
  
  
  1.3       +2 -2      jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider/BasicFileName.java
  
  Index: BasicFileName.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider/BasicFileName.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- BasicFileName.java	12 Feb 2003 07:42:41 -0000	1.2
  +++ BasicFileName.java	17 Feb 2003 09:22:14 -0000	1.3
  @@ -65,7 +65,7 @@
    * @version $Revision$ $Date$
    */
   public class BasicFileName
  -    extends DefaultFileName
  +    extends AbstractFileName
   {
       private final String rootUri;
   
  
  
  
  1.7       +2 -2      jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider/GenericFileName.java
  
  Index: GenericFileName.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider/GenericFileName.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- GenericFileName.java	15 Feb 2003 00:07:45 -0000	1.6
  +++ GenericFileName.java	17 Feb 2003 09:22:14 -0000	1.7
  @@ -67,7 +67,7 @@
    * @version $Revision$ $Date$
    */
   public class GenericFileName
  -    extends DefaultFileName
  +    extends AbstractFileName
   {
       private final String userName;
       private final String hostName;
  
  
  
  1.5       +2 -2      jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider/LayeredFileName.java
  
  Index: LayeredFileName.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider/LayeredFileName.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- LayeredFileName.java	12 Feb 2003 07:56:13 -0000	1.4
  +++ LayeredFileName.java	17 Feb 2003 09:22:14 -0000	1.5
  @@ -62,7 +62,7 @@
    * @version $Revision$ $Date$
    */
   public abstract class LayeredFileName
  -    extends DefaultFileName
  +    extends AbstractFileName
   {
       private final String outerUri;
   
  
  
  
  1.1                  jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider/AbstractFileName.java
  
  Index: AbstractFileName.java
  ===================================================================
  /* ====================================================================
   *
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2002, 2003 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution, if
   *    any, must include the following acknowlegement:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Commons", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names without prior written
   *    permission of the Apache Group.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   *
   */
  package org.apache.commons.vfs.provider;
  
  import org.apache.commons.vfs.FileName;
  import org.apache.commons.vfs.FileSystemException;
  import org.apache.commons.vfs.NameScope;
  
  /**
   * A default file name implementation.
   *
   * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a>
   * @version $Revision: 1.1 $ $Date: 2003/02/17 09:22:14 $
   */
  public abstract class AbstractFileName
      implements FileName
  {
      private final String scheme;
      private final String absPath;
  
      // Cached stuff
      private String uri;
      private String baseName;
      private String rootUri;
      private String extension;
  
      public AbstractFileName( final String scheme,
                              final String absPath )
      {
          this.scheme = scheme;
          if ( absPath != null && absPath.length() > 0 )
          {
              this.absPath = absPath;
          }
          else
          {
              this.absPath = ROOT_PATH;
          }
      }
  
      /**
       * Returns the hashcode for this name.
       */
      public int hashCode()
      {
          return ( getRootURI().hashCode() ^ absPath.hashCode() );
      }
  
      /**
       * Determines if this object is equal to another.
       */
      public boolean equals( final Object obj )
      {
          final AbstractFileName name = (AbstractFileName)obj;
          return ( getRootURI().equals( name.getRootURI() ) && absPath.equals( absPath ) );
      }
  
      /**
       * Returns the URI of the file.
       */
      public String toString()
      {
          return getURI();
      }
  
      /**
       * Factory method for creating name instances.
       */
      protected abstract FileName createName( String absPath );
  
      /**
       * Builds the root URI for this file name.  Note that the root URI must not
       * end with a separator character.
       */
      protected abstract void appendRootUri( StringBuffer buffer );
  
      /**
       * Returns the base name of the file.
       */
      public String getBaseName()
      {
          if ( baseName == null )
          {
              final int idx = absPath.lastIndexOf( SEPARATOR_CHAR );
              if ( idx == -1 )
              {
                  baseName = absPath;
              }
              else
              {
                  baseName = absPath.substring( idx + 1 );
              }
          }
  
          return baseName;
      }
  
      /**
       * Returns the absolute path of the file, relative to the root of the
       * file system that the file belongs to.
       */
      public String getPath()
      {
          return absPath;
      }
  
      /**
       * Resolves a name, relative to this file name.
       */
      public FileName resolveName( final String name,
                                   final NameScope scope )
          throws FileSystemException
      {
          final StringBuffer buffer = new StringBuffer( name );
  
          // Adjust separators
          UriParser.fixSeparators( buffer );
  
          // Determine whether to prepend the base path
          if ( name.length() == 0 || name.charAt( 0 ) != SEPARATOR_CHAR )
          {
              // Supplied path is not absolute
              buffer.insert( 0, SEPARATOR_CHAR );
              buffer.insert( 0, absPath );
          }
  
          // Normalise the path
          UriParser.normalisePath( buffer );
  
          // Check the name is ok
          final String resolvedPath = buffer.toString();
          if ( !checkName( absPath, resolvedPath, scope ) )
          {
              throw new FileSystemException( "vfs.provider/invalid-descendent-name.error", name );
          }
  
          return createName( resolvedPath );
      }
  
      /**
       * Returns the name of the parent of the file.
       */
      public FileName getParent()
      {
          final String parentPath;
          final int idx = absPath.lastIndexOf( SEPARATOR_CHAR );
          if ( idx == -1 || idx == absPath.length() - 1 )
          {
              // No parent
              return null;
          }
          else if ( idx == 0 )
          {
              // Root is the parent
              parentPath = SEPARATOR;
          }
          else
          {
              parentPath = absPath.substring( 0, idx );
          }
          return createName( parentPath );
      }
  
      /**
       * Resolves a name, relative to the file.  If the supplied name is an
       * absolute path, then it is resolved relative to the root of the
       * file system that the file belongs to.  If a relative name is supplied,
       * then it is resolved relative to this file name.
       */
      public FileName resolveName( final String path ) throws FileSystemException
      {
          return resolveName( path, NameScope.FILE_SYSTEM );
      }
  
      /**
       * Returns the URI scheme of this file.
       */
      public String getScheme()
      {
          return scheme;
      }
  
      /**
       * Returns the absolute URI of the file.
       */
      public String getURI()
      {
          if ( uri == null )
          {
              final StringBuffer buffer = new StringBuffer();
              appendRootUri( buffer );
              buffer.append( absPath );
              uri = buffer.toString();
          }
          return uri;
      }
  
      /**
       * Converts a file name to a relative name, relative to this file name.
       */
      public String getRelativeName( final FileName name ) throws FileSystemException
      {
          final String path = name.getPath();
  
          // Calculate the common prefix
          final int basePathLen = absPath.length();
          final int pathLen = path.length();
  
          // Deal with root
          if ( basePathLen == 1 && pathLen == 1 )
          {
              return ".";
          }
          else if ( basePathLen == 1 )
          {
              return path.substring( 1 );
          }
  
          final int maxlen = Math.min( basePathLen, pathLen );
          int pos = 0;
          for ( ; pos < maxlen && absPath.charAt( pos ) == path.charAt( pos ); pos++ )
          {
          }
  
          if ( pos == basePathLen && pos == pathLen )
          {
              // Same names
              return ".";
          }
          else if ( pos == basePathLen && pos < pathLen && path.charAt( pos ) == SEPARATOR_CHAR )
          {
              // A descendent of the base path
              return path.substring( pos + 1 );
          }
  
          // Strip the common prefix off the path
          final StringBuffer buffer = new StringBuffer();
          if ( pathLen > 1 && ( pos < pathLen || absPath.charAt( pos ) != SEPARATOR_CHAR ) )
          {
              // Not a direct ancestor, need to back up
              pos = absPath.lastIndexOf( SEPARATOR_CHAR, pos );
              buffer.append( path.substring( pos ) );
          }
  
          // Prepend a '../' for each element in the base path past the common
          // prefix
          buffer.insert( 0, ".." );
          pos = absPath.indexOf( SEPARATOR_CHAR, pos + 1 );
          while ( pos != -1 )
          {
              buffer.insert( 0, "../" );
              pos = absPath.indexOf( SEPARATOR_CHAR, pos + 1 );
          }
  
          return buffer.toString();
      }
  
      /**
       * Returns the root URI of the file system this file belongs to.
       */
      public String getRootURI()
      {
          if ( rootUri == null )
          {
              final StringBuffer buffer = new StringBuffer();
              appendRootUri( buffer );
              buffer.append( SEPARATOR_CHAR );
              rootUri = buffer.toString();
          }
          return rootUri;
      }
  
      /**
       * Returns the depth of this file name, within its file system.
       */
      public int getDepth()
      {
          final int len = absPath.length();
          if ( len == 0 || ( len == 1 && absPath.charAt( 0 ) == SEPARATOR_CHAR ) )
          {
              return 0;
          }
          int depth = 1;
          for ( int pos = 0; pos > -1 && pos < len; depth++ )
          {
              pos = absPath.indexOf( SEPARATOR_CHAR, pos + 1 );
          }
          return depth;
      }
  
      /**
       * Returns the extension of this file name.
       */
      public String getExtension()
      {
          if ( extension == null )
          {
              getBaseName();
              final int pos = baseName.lastIndexOf( '.' );
              if ( ( pos == -1 ) || ( pos == baseName.length() - 1 ) )
              {
                  // No extension
                  extension = "";
              }
              else
              {
                  extension = baseName.substring( 0, pos );
              }
          }
          return extension;
      }
  
      /**
       * Determines if another file name is an ancestor of this file name.
       */
      public boolean isAncestor( final FileName ancestor )
      {
          if ( !ancestor.getRootURI().equals( getRootURI() ) )
          {
              return false;
          }
          return checkName( ancestor.getPath(), absPath, NameScope.DESCENDENT );
      }
  
      /**
       * Determines if another file name is a descendent of this file name.
       */
      public boolean isDescendent( final FileName descendent )
      {
          return isDescendent( descendent, NameScope.DESCENDENT );
      }
  
      /**
       * Determines if another file name is a descendent of this file name.
       */
      public boolean isDescendent( final FileName descendent,
                                   final NameScope scope )
      {
          if ( !descendent.getRootURI().equals( getRootURI() ) )
          {
              return false;
          }
          return checkName( absPath, descendent.getPath(), scope );
      }
  
      /**
       * Checks whether a path fits in a particular scope of another path.
       *
       * @param basePath An absolute, normalised path.
       * @param path An absolute, normalised path.
       */
      private boolean checkName( final String basePath,
                                 final String path,
                                 final NameScope scope )
      {
          if ( scope == NameScope.FILE_SYSTEM )
          {
              // All good
              return true;
          }
  
          if ( !path.startsWith( basePath ) )
          {
              return false;
          }
          final int baseLen = basePath.length();
  
          if ( scope == NameScope.CHILD )
          {
              if ( path.length() == baseLen
                  || ( baseLen > 1 && path.charAt( baseLen ) != SEPARATOR_CHAR )
                  || path.indexOf( SEPARATOR_CHAR, baseLen + 1 ) != -1 )
              {
                  return false;
              }
          }
          else if ( scope == NameScope.DESCENDENT )
          {
              if ( path.length() == baseLen
                  || ( baseLen > 1 && path.charAt( baseLen ) != SEPARATOR_CHAR ) )
              {
                  return false;
              }
          }
          else if ( scope == NameScope.DESCENDENT_OR_SELF )
          {
              if ( baseLen > 1
                  && path.length() > baseLen
                  && path.charAt( baseLen ) != SEPARATOR_CHAR )
              {
                  return false;
              }
          }
          else if ( scope != NameScope.FILE_SYSTEM )
          {
              throw new IllegalArgumentException();
          }
  
          return true;
      }
  }
  
  
  
  1.6       +92 -17    jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider/AbstractFileProvider.java
  
  
  
  
  1.1                  jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider/ftp/FtpFileProvider.java
  
  Index: FtpFileProvider.java
  ===================================================================
  /* ====================================================================
   *
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2002, 2003 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution, if
   *    any, must include the following acknowlegement:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Commons", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names without prior written
   *    permission of the Apache Group.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   *
   */
  package org.apache.commons.vfs.provider.ftp;
  
  import org.apache.commons.vfs.FileName;
  import org.apache.commons.vfs.FileSystem;
  import org.apache.commons.vfs.FileSystemException;
  import org.apache.commons.vfs.provider.AbstractOriginatingFileProvider;
  import org.apache.commons.vfs.provider.GenericFileName;
  
  /**
   * A provider for FTP file systems.
   *
   * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a>
   * @version $Revision: 1.1 $ $Date: 2003/02/17 09:22:14 $
   */
  public final class FtpFileProvider
      extends AbstractOriginatingFileProvider
  {
      private static final int DEFAULT_PORT = 21;
  
      /**
       * Parses a URI.
       */
      protected FileName parseUri( final String uri )
          throws FileSystemException
      {
          return GenericFileName.parseUri( uri, DEFAULT_PORT );
      }
  
      /**
       * Creates the filesystem.
       */
      protected FileSystem doCreateFileSystem( final FileName name )
          throws FileSystemException
      {
          // Create the file system
          final GenericFileName rootName = (GenericFileName)name;
          return new FtpFileSystem( rootName );
      }
  }
  
  
  
  1.1                  jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider/jar/JarFileProvider.java
  
  Index: JarFileProvider.java
  ===================================================================
  /* ====================================================================
   *
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2002, 2003 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution, if
   *    any, must include the following acknowlegement:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Commons", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names without prior written
   *    permission of the Apache Group.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   *
   */
  package org.apache.commons.vfs.provider.jar;
  
  import org.apache.commons.vfs.FileName;
  import org.apache.commons.vfs.FileObject;
  import org.apache.commons.vfs.FileSystem;
  import org.apache.commons.vfs.FileSystemException;
  import org.apache.commons.vfs.provider.zip.ZipFileName;
  import org.apache.commons.vfs.provider.zip.ZipFileProvider;
  
  /**
   * A file system provider for Jar files.  Provides read-only file
   * systems.  This provides access to Jar specific features like Signing and
   * Manifest Attributes.
   *
   * @author <a href="mailto:brian@mmmanager.org">Brian Olsen</a>
   * @version $Revision: 1.1 $ $Date: 2003/02/17 09:22:15 $
   */
  public class JarFileProvider
      extends ZipFileProvider
  {
      /**
       * Creates a layered file system.  This method is called if the file system
       * is not cached.
       * @param scheme The URI scheme.
       * @param file The file to create the file system on top of.
       * @return The file system.
       */
      protected FileSystem doCreateFileSystem( String scheme,
                                               FileObject file )
          throws FileSystemException
      {
          final FileName name =
              new ZipFileName( scheme, file.getName().getURI(), FileName.ROOT_PATH );
          return new JarFileSystem( name, file );
      }
  }
  
  
  
  1.5       +3 -3      jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider/local/LocalFileName.java
  
  Index: LocalFileName.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider/local/LocalFileName.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- LocalFileName.java	12 Feb 2003 07:56:15 -0000	1.4
  +++ LocalFileName.java	17 Feb 2003 09:22:15 -0000	1.5
  @@ -57,7 +57,7 @@
   
   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.AbstractFileName;
   import org.apache.commons.vfs.provider.UriParser;
   
   /**
  @@ -67,7 +67,7 @@
    * @version $Revision$ $Date$
    */
   class LocalFileName
  -    extends DefaultFileName
  +    extends AbstractFileName
   {
       private final String rootFile;
   
  
  
  
  1.1                  jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider/local/DefaultLocalFileProvider.java
  
  Index: DefaultLocalFileProvider.java
  ===================================================================
  /* ====================================================================
   *
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2002, 2003 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution, if
   *    any, must include the following acknowlegement:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Commons", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names without prior written
   *    permission of the Apache Group.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   *
   */
  package org.apache.commons.vfs.provider.local;
  
  import java.io.File;
  import org.apache.commons.vfs.FileName;
  import org.apache.commons.vfs.FileObject;
  import org.apache.commons.vfs.FileSystem;
  import org.apache.commons.vfs.FileSystemException;
  import org.apache.commons.vfs.provider.AbstractOriginatingFileProvider;
  import org.apache.commons.vfs.provider.LocalFileProvider;
  import org.apache.commons.vfs.util.Os;
  
  /**
   * A file system provider, which uses direct file access.
   *
   * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a>
   * @version $Revision: 1.1 $ $Date: 2003/02/17 09:22:15 $
   */
  public final class DefaultLocalFileProvider
      extends AbstractOriginatingFileProvider
      implements LocalFileProvider
  {
      private final LocalFileNameParser parser;
  
      public DefaultLocalFileProvider()
      {
          if ( Os.isFamily( Os.OS_FAMILY_WINDOWS ) )
          {
              parser = new WindowsFileNameParser();
          }
          else
          {
              parser = new GenericFileNameParser();
          }
      }
  
      /**
       * Determines if a name is an absolute file name.
       */
      public boolean isAbsoluteLocalName( final String name )
      {
          return parser.isAbsoluteName( name );
      }
  
      /**
       * Finds a local file, from its local name.
       */
      public FileObject findLocalFile( final String name )
          throws FileSystemException
      {
          // TODO - tidy this up, no need to turn the name into an absolute URI,
          // and then straight back again
          return findFile( null, "file:" + name );
      }
  
      /**
       * Finds a local file.
       */
      public FileObject findLocalFile( final File file )
          throws FileSystemException
      {
          // TODO - tidy this up, should build file object straight from the file
          return findFile( null, "file:" + file.getAbsolutePath() );
      }
  
      /**
       * Parses a URI.
       */
      protected FileName parseUri( final String uri )
          throws FileSystemException
      {
          return LocalFileName.parseUri( uri, parser );
      }
  
      /**
       * Creates the filesystem.
       */
      protected FileSystem doCreateFileSystem( final FileName name )
          throws FileSystemException
      {
          // Create the file system
          final LocalFileName rootName = (LocalFileName)name;
          return new LocalFileSystem( rootName, rootName.getRootFile() );
      }
  }
  
  
  
  1.1                  jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider/smb/SmbFileProvider.java
  
  Index: SmbFileProvider.java
  ===================================================================
  /* ====================================================================
   *
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2002, 2003 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution, if
   *    any, must include the following acknowlegement:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Commons", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names without prior written
   *    permission of the Apache Group.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   *
   */
  package org.apache.commons.vfs.provider.smb;
  
  import org.apache.commons.vfs.FileName;
  import org.apache.commons.vfs.FileSystem;
  import org.apache.commons.vfs.FileSystemException;
  import org.apache.commons.vfs.provider.AbstractOriginatingFileProvider;
  import org.apache.commons.vfs.provider.FileProvider;
  
  /**
   * A provider for SMB (Samba, Windows share) file systems.
   *
   * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a>
   * @version $Revision: 1.1 $ $Date: 2003/02/17 09:22:15 $
   */
  public final class SmbFileProvider
      extends AbstractOriginatingFileProvider
      implements FileProvider
  {
      /**
       * Parses a URI.
       */
      protected FileName parseUri( final String uri )
          throws FileSystemException
      {
          return SmbFileName.parseUri( uri );
      }
  
      /**
       * Creates the filesystem.
       */
      protected FileSystem doCreateFileSystem( final FileName name )
          throws FileSystemException
      {
          return new SmbFileSystem( name );
      }
  }
  
  
  
  1.8       +3 -3      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.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- TemporaryFileProvider.java	12 Feb 2003 07:56:16 -0000	1.7
  +++ TemporaryFileProvider.java	17 Feb 2003 09:22:15 -0000	1.8
  @@ -60,7 +60,7 @@
   import org.apache.commons.vfs.FileObject;
   import org.apache.commons.vfs.FileSystem;
   import org.apache.commons.vfs.FileSystemException;
  -import org.apache.commons.vfs.provider.AbstractFileSystemProvider;
  +import org.apache.commons.vfs.provider.AbstractFileProvider;
   import org.apache.commons.vfs.provider.BasicFileName;
   import org.apache.commons.vfs.provider.FileProvider;
   import org.apache.commons.vfs.provider.UriParser;
  @@ -73,7 +73,7 @@
    * @version $Revision$ $Date$
    */
   public class TemporaryFileProvider
  -    extends AbstractFileSystemProvider
  +    extends AbstractFileProvider
       implements FileProvider
   {
       private File rootFile;
  
  
  
  1.14      +3 -3      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.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- UrlFileProvider.java	12 Feb 2003 07:56:17 -0000	1.13
  +++ UrlFileProvider.java	17 Feb 2003 09:22:15 -0000	1.14
  @@ -61,7 +61,7 @@
   import org.apache.commons.vfs.FileObject;
   import org.apache.commons.vfs.FileSystem;
   import org.apache.commons.vfs.FileSystemException;
  -import org.apache.commons.vfs.provider.AbstractFileSystemProvider;
  +import org.apache.commons.vfs.provider.AbstractFileProvider;
   import org.apache.commons.vfs.provider.BasicFileName;
   
   /**
  @@ -71,7 +71,7 @@
    * @version $Revision$ $Date$
    */
   public class UrlFileProvider
  -    extends AbstractFileSystemProvider
  +    extends AbstractFileProvider
   {
       /**
        * Locates a file object, by absolute URI.
  
  
  
  1.1                  jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider/webdav/WebdavFileProvider.java
  
  Index: WebdavFileProvider.java
  ===================================================================
  /* ====================================================================
   *
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2003 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution, if
   *    any, must include the following acknowlegement:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Commons", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names without prior written
   *    permission of the Apache Group.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   *
   */
  package org.apache.commons.vfs.provider.webdav;
  
  import org.apache.commons.vfs.FileName;
  import org.apache.commons.vfs.FileSystem;
  import org.apache.commons.vfs.FileSystemException;
  import org.apache.commons.vfs.provider.AbstractOriginatingFileProvider;
  import org.apache.commons.vfs.provider.GenericFileName;
  
  /**
   * A provider for WebDAV.
   *
   * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a>
   * @version $Revision: 1.1 $ $Date: 2003/02/17 09:22:15 $
   */
  public class WebdavFileProvider
      extends AbstractOriginatingFileProvider
  {
      /**
       * Parses an abolute URI.
       */
      protected FileName parseUri( final String uri )
          throws FileSystemException
      {
          return GenericFileName.parseUri( uri, 80 );
      }
  
      /**
       * Creates a filesystem.
       */
      protected FileSystem doCreateFileSystem( final FileName name )
          throws FileSystemException
      {
          final GenericFileName rootName = (GenericFileName)name;
          return new WebDavFileSystem( rootName );
      }
  }
  
  
  
  1.1                  jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider/zip/ZipFileProvider.java
  
  Index: ZipFileProvider.java
  ===================================================================
  /* ====================================================================
   *
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2002, 2003 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution, if
   *    any, must include the following acknowlegement:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Commons", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names without prior written
   *    permission of the Apache Group.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   *
   */
  package org.apache.commons.vfs.provider.zip;
  
  import org.apache.commons.vfs.FileName;
  import org.apache.commons.vfs.FileObject;
  import org.apache.commons.vfs.FileSystem;
  import org.apache.commons.vfs.FileSystemException;
  import org.apache.commons.vfs.provider.AbstractLayeredFileProvider;
  import org.apache.commons.vfs.provider.FileProvider;
  
  /**
   * A file system provider for Zip files.  Provides read-only file systems.
   *
   * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a>
   * @version $Revision: 1.1 $ $Date: 2003/02/17 09:22:15 $
   */
  public class ZipFileProvider
      extends AbstractLayeredFileProvider
      implements FileProvider
  {
      /**
       * Parses an absolute URI.
       * @param uri The URI to parse.
       */
      protected FileName parseUri( final String uri )
          throws FileSystemException
      {
          return ZipFileName.parseUri( uri );
      }
  
      /**
       * Creates a layered file system.  This method is called if the file system
       * is not cached.
       * @param scheme The URI scheme.
       * @param file The file to create the file system on top of.
       * @return The file system.
       */
      protected FileSystem doCreateFileSystem( final String scheme,
                                               final FileObject file )
          throws FileSystemException
      {
          final FileName rootName =
              new ZipFileName( scheme, file.getName().getURI(), FileName.ROOT_PATH );
          return new ZipFileSystem( rootName, file );
      }
  }
  
  
  
  1.7       +2 -2      jakarta-commons-sandbox/vfs/src/test/org/apache/commons/vfs/provider/ftp/test/FtpProviderTestCase.java
  
  Index: FtpProviderTestCase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/vfs/src/test/org/apache/commons/vfs/provider/ftp/test/FtpProviderTestCase.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- FtpProviderTestCase.java	15 Feb 2003 00:15:19 -0000	1.6
  +++ FtpProviderTestCase.java	17 Feb 2003 09:22:15 -0000	1.7
  @@ -59,7 +59,7 @@
   import org.apache.commons.vfs.FileObject;
   import org.apache.commons.vfs.FileSystemManager;
   import org.apache.commons.vfs.impl.DefaultFileSystemManager;
  -import org.apache.commons.vfs.provider.ftp.FtpFileSystemProvider;
  +import org.apache.commons.vfs.provider.ftp.FtpFileProvider;
   import org.apache.commons.vfs.test.AbstractProviderTestConfig;
   import org.apache.commons.vfs.test.ProviderTestConfig;
   import org.apache.commons.vfs.test.ProviderTestSuite;
  @@ -86,7 +86,7 @@
        */
       public void prepare( final DefaultFileSystemManager manager ) throws Exception
       {
  -        manager.addProvider( "ftp", new FtpFileSystemProvider() );
  +        manager.addProvider( "ftp", new FtpFileProvider() );
       }
   
       /**
  
  
  
  1.7       +2 -2      jakarta-commons-sandbox/vfs/src/test/org/apache/commons/vfs/provider/jar/test/JarProviderTestCase.java
  
  Index: JarProviderTestCase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/vfs/src/test/org/apache/commons/vfs/provider/jar/test/JarProviderTestCase.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- JarProviderTestCase.java	12 Feb 2003 07:56:18 -0000	1.6
  +++ JarProviderTestCase.java	17 Feb 2003 09:22:15 -0000	1.7
  @@ -61,7 +61,7 @@
   import org.apache.commons.vfs.FileObject;
   import org.apache.commons.vfs.FileSystemManager;
   import org.apache.commons.vfs.impl.DefaultFileSystemManager;
  -import org.apache.commons.vfs.provider.jar.JarFileSystemProvider;
  +import org.apache.commons.vfs.provider.jar.JarFileProvider;
   import org.apache.commons.vfs.test.AbstractProviderTestConfig;
   import org.apache.commons.vfs.test.ProviderTestConfig;
   import org.apache.commons.vfs.test.ProviderTestSuite;
  @@ -89,7 +89,7 @@
       public void prepare( final DefaultFileSystemManager manager )
           throws Exception
       {
  -        manager.addProvider( "jar", new JarFileSystemProvider() );
  +        manager.addProvider( "jar", new JarFileProvider() );
       }
   
       /**
  
  
  
  1.7       +2 -2      jakarta-commons-sandbox/vfs/src/test/org/apache/commons/vfs/provider/jar/test/NestedJarTestCase.java
  
  Index: NestedJarTestCase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/vfs/src/test/org/apache/commons/vfs/provider/jar/test/NestedJarTestCase.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- NestedJarTestCase.java	12 Feb 2003 07:56:18 -0000	1.6
  +++ NestedJarTestCase.java	17 Feb 2003 09:22:15 -0000	1.7
  @@ -61,7 +61,7 @@
   import org.apache.commons.vfs.FileObject;
   import org.apache.commons.vfs.FileSystemManager;
   import org.apache.commons.vfs.impl.DefaultFileSystemManager;
  -import org.apache.commons.vfs.provider.jar.JarFileSystemProvider;
  +import org.apache.commons.vfs.provider.jar.JarFileProvider;
   import org.apache.commons.vfs.test.AbstractProviderTestConfig;
   import org.apache.commons.vfs.test.ProviderTestConfig;
   import org.apache.commons.vfs.test.ProviderTestSuite;
  @@ -89,7 +89,7 @@
       public void prepare( final DefaultFileSystemManager manager )
           throws Exception
       {
  -        manager.addProvider( "jar", new JarFileSystemProvider() );
  +        manager.addProvider( "jar", new JarFileProvider() );
       }
   
       /**
  
  
  
  1.8       +2 -2      jakarta-commons-sandbox/vfs/src/test/org/apache/commons/vfs/provider/smb/test/SmbProviderTestCase.java
  
  Index: SmbProviderTestCase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/vfs/src/test/org/apache/commons/vfs/provider/smb/test/SmbProviderTestCase.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- SmbProviderTestCase.java	15 Feb 2003 00:14:45 -0000	1.7
  +++ SmbProviderTestCase.java	17 Feb 2003 09:22:15 -0000	1.8
  @@ -59,7 +59,7 @@
   import org.apache.commons.vfs.FileObject;
   import org.apache.commons.vfs.FileSystemManager;
   import org.apache.commons.vfs.impl.DefaultFileSystemManager;
  -import org.apache.commons.vfs.provider.smb.SmbFileSystemProvider;
  +import org.apache.commons.vfs.provider.smb.SmbFileProvider;
   import org.apache.commons.vfs.test.AbstractProviderTestConfig;
   import org.apache.commons.vfs.test.ProviderTestConfig;
   import org.apache.commons.vfs.test.ProviderTestSuite;
  @@ -84,7 +84,7 @@
       public void prepare( final DefaultFileSystemManager manager )
           throws Exception
       {
  -        manager.addProvider( "smb", new SmbFileSystemProvider() );
  +        manager.addProvider( "smb", new SmbFileProvider() );
       }
   
       /**
  
  
  
  1.5       +3 -3      jakarta-commons-sandbox/vfs/src/test/org/apache/commons/vfs/provider/url/test/UrlProviderTestCase.java
  
  Index: UrlProviderTestCase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/vfs/src/test/org/apache/commons/vfs/provider/url/test/UrlProviderTestCase.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- UrlProviderTestCase.java	12 Feb 2003 07:56:19 -0000	1.4
  +++ UrlProviderTestCase.java	17 Feb 2003 09:22:16 -0000	1.5
  @@ -63,7 +63,7 @@
   import org.apache.commons.vfs.FileSystemManager;
   import org.apache.commons.vfs.impl.DefaultFileSystemManager;
   import org.apache.commons.vfs.provider.url.UrlFileProvider;
  -import org.apache.commons.vfs.provider.jar.JarFileSystemProvider;
  +import org.apache.commons.vfs.provider.jar.JarFileProvider;
   import org.apache.commons.vfs.test.AbstractProviderTestConfig;
   import org.apache.commons.vfs.test.ProviderTestSuite;
   
  @@ -88,7 +88,7 @@
           throws Exception
       {
           manager.addProvider( "file", new UrlFileProvider() );
  -        manager.addProvider( "jar", new JarFileSystemProvider() );
  +        manager.addProvider( "jar", new JarFileProvider() );
       }
   
       /**
  
  
  
  1.2       +3 -3      jakarta-commons-sandbox/vfs/src/test/org/apache/commons/vfs/provider/webdav/test/WebdavProviderTestCase.java
  
  Index: WebdavProviderTestCase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/vfs/src/test/org/apache/commons/vfs/provider/webdav/test/WebdavProviderTestCase.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- WebdavProviderTestCase.java	15 Feb 2003 00:19:50 -0000	1.1
  +++ WebdavProviderTestCase.java	17 Feb 2003 09:22:16 -0000	1.2
  @@ -59,7 +59,7 @@
   import org.apache.commons.vfs.test.ProviderTestSuite;
   import org.apache.commons.vfs.FileObject;
   import org.apache.commons.vfs.FileSystemManager;
  -import org.apache.commons.vfs.provider.webdav.WebdavProvider;
  +import org.apache.commons.vfs.provider.webdav.WebdavFileProvider;
   import org.apache.commons.vfs.impl.DefaultFileSystemManager;
   import junit.framework.Test;
   
  @@ -83,7 +83,7 @@
       public void prepare( final DefaultFileSystemManager manager )
           throws Exception
       {
  -        manager.addProvider( "webdav", new WebdavProvider() );
  +        manager.addProvider( "webdav", new WebdavFileProvider() );
       }
   
       /**
  
  
  
  1.5       +2 -2      jakarta-commons-sandbox/vfs/src/test/org/apache/commons/vfs/provider/zip/test/NestedZipTestCase.java
  
  Index: NestedZipTestCase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/vfs/src/test/org/apache/commons/vfs/provider/zip/test/NestedZipTestCase.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- NestedZipTestCase.java	12 Feb 2003 07:56:19 -0000	1.4
  +++ NestedZipTestCase.java	17 Feb 2003 09:22:16 -0000	1.5
  @@ -60,7 +60,7 @@
   import org.apache.commons.vfs.FileObject;
   import org.apache.commons.vfs.FileSystemManager;
   import org.apache.commons.vfs.impl.DefaultFileSystemManager;
  -import org.apache.commons.vfs.provider.zip.ZipFileSystemProvider;
  +import org.apache.commons.vfs.provider.zip.ZipFileProvider;
   import org.apache.commons.vfs.test.AbstractProviderTestConfig;
   import org.apache.commons.vfs.test.ProviderTestConfig;
   import org.apache.commons.vfs.test.ProviderTestSuite;
  @@ -88,7 +88,7 @@
       public void prepare( final DefaultFileSystemManager manager )
           throws Exception
       {
  -        manager.addProvider( "zip", new ZipFileSystemProvider() );
  +        manager.addProvider( "zip", new ZipFileProvider() );
       }
   
       /**
  
  
  
  1.5       +2 -2      jakarta-commons-sandbox/vfs/src/test/org/apache/commons/vfs/provider/zip/test/ZipProviderTestCase.java
  
  Index: ZipProviderTestCase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/vfs/src/test/org/apache/commons/vfs/provider/zip/test/ZipProviderTestCase.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ZipProviderTestCase.java	12 Feb 2003 07:56:19 -0000	1.4
  +++ ZipProviderTestCase.java	17 Feb 2003 09:22:16 -0000	1.5
  @@ -61,7 +61,7 @@
   import org.apache.commons.vfs.FileObject;
   import org.apache.commons.vfs.FileSystemManager;
   import org.apache.commons.vfs.impl.DefaultFileSystemManager;
  -import org.apache.commons.vfs.provider.zip.ZipFileSystemProvider;
  +import org.apache.commons.vfs.provider.zip.ZipFileProvider;
   import org.apache.commons.vfs.test.AbstractProviderTestConfig;
   import org.apache.commons.vfs.test.ProviderTestConfig;
   import org.apache.commons.vfs.test.ProviderTestSuite;
  @@ -88,7 +88,7 @@
        */
       public void prepare( final DefaultFileSystemManager manager ) throws Exception
       {
  -        manager.addProvider( "zip", new ZipFileSystemProvider() );
  +        manager.addProvider( "zip", new ZipFileProvider() );
       }
   
       /**
  
  
  
  1.9       +3 -3      jakarta-commons-sandbox/vfs/src/test/org/apache/commons/vfs/test/AbstractProviderTestCase.java
  
  Index: AbstractProviderTestCase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/vfs/src/test/org/apache/commons/vfs/test/AbstractProviderTestCase.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- AbstractProviderTestCase.java	12 Feb 2003 07:56:19 -0000	1.8
  +++ AbstractProviderTestCase.java	17 Feb 2003 09:22:16 -0000	1.9
  @@ -71,7 +71,7 @@
   import org.apache.commons.vfs.impl.DefaultFileReplicator;
   import org.apache.commons.vfs.impl.DefaultFileSystemManager;
   import org.apache.commons.vfs.impl.PrivilegedFileReplicator;
  -import org.apache.commons.vfs.provider.local.DefaultLocalFileSystemProvider;
  +import org.apache.commons.vfs.provider.local.DefaultLocalFileProvider;
   
   /**
    * File system test cases, which verifies the structure and naming
  @@ -165,7 +165,7 @@
   
           // Create the file system manager
           manager = new DefaultFileSystemManager();
  -        manager.addProvider( "file", new DefaultLocalFileSystemProvider() );
  +        manager.addProvider( "file", new DefaultLocalFileProvider() );
   
           final DefaultFileReplicator replicator = new DefaultFileReplicator( tempDir );
           manager.setReplicator( new PrivilegedFileReplicator( replicator ) );
  
  
  

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


Mime
View raw message