ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From adammurd...@apache.org
Subject cvs commit: jakarta-ant-myrmidon/aut/src/java/org/apache/aut/vfs/provider/zip ZipFileSystemProvider.java
Date Mon, 17 Jun 2002 07:19:46 GMT
adammurdoch    2002/06/17 00:19:46

  Modified:    framework/src/java/org/apache/myrmidon/framework/factories
                        VfsManager.java
               aut/src/java/org/apache/aut/vfs/impl
                        DefaultFileSystemManager.java
               aut/src/java/org/apache/aut/vfs/provider
                        AbstractFileSystemProvider.java
               aut/src/java/org/apache/aut/vfs/provider/ftp
                        FtpFileSystemProvider.java
               aut/src/java/org/apache/aut/vfs/provider/local
                        DefaultLocalFileSystemProvider.java
               aut/src/java/org/apache/aut/vfs/provider/smb
                        SmbFileSystemProvider.java
               aut/src/java/org/apache/aut/vfs/provider/zip
                        ZipFileSystemProvider.java
  Added:       aut/src/java/org/apache/aut/vfs/provider
                        AbstractFileProvider.java FileProvider.java
                        LocalFileProvider.java
  Removed:     aut/src/java/org/apache/aut/vfs/provider
                        FileSystemProvider.java
                        LocalFileSystemProvider.java
  Log:
  * Renamed FileSystemProvider to FileProvider.
  * Renamed LocalFileSystemProvider to LocalFileProvider.
  * Extracted AbstractFileProvider out of AbstractFileSystemProvider.
  
  Revision  Changes    Path
  1.2       +5 -5      jakarta-ant-myrmidon/framework/src/java/org/apache/myrmidon/framework/factories/VfsManager.java
  
  Index: VfsManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/framework/src/java/org/apache/myrmidon/framework/factories/VfsManager.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- VfsManager.java	14 Apr 2002 09:30:14 -0000	1.1
  +++ VfsManager.java	17 Jun 2002 07:19:45 -0000	1.2
  @@ -9,7 +9,7 @@
   
   import org.apache.aut.vfs.FileSystemException;
   import org.apache.aut.vfs.impl.DefaultFileSystemManager;
  -import org.apache.aut.vfs.provider.FileSystemProvider;
  +import org.apache.aut.vfs.provider.FileProvider;
   import org.apache.avalon.excalibur.i18n.ResourceManager;
   import org.apache.avalon.excalibur.i18n.Resources;
   import org.apache.avalon.framework.activity.Initializable;
  @@ -47,7 +47,7 @@
        */
       public void initialize() throws Exception
       {
  -        final TypeFactory factory = m_typeManager.getFactory( FileSystemProvider.ROLE );
  +        final TypeFactory factory = m_typeManager.getFactory( FileProvider.ROLE );
   
           // TODO - make this list configurable
   
  @@ -75,10 +75,10 @@
               return;
           }
   
  -        final FileSystemProvider provider;
  +        final FileProvider provider;
           try
           {
  -            provider = (FileSystemProvider)factory.create( providerName );
  +            provider = (FileProvider)factory.create( providerName );
           }
           catch( Exception e )
           {
  
  
  
  1.9       +13 -13    jakarta-ant-myrmidon/aut/src/java/org/apache/aut/vfs/impl/DefaultFileSystemManager.java
  
  Index: DefaultFileSystemManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/aut/src/java/org/apache/aut/vfs/impl/DefaultFileSystemManager.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- DefaultFileSystemManager.java	17 Jun 2002 00:06:16 -0000	1.8
  +++ DefaultFileSystemManager.java	17 Jun 2002 07:19:45 -0000	1.9
  @@ -20,8 +20,8 @@
   import org.apache.aut.vfs.FileSystemManager;
   import org.apache.aut.vfs.provider.DefaultURLStreamHandler;
   import org.apache.aut.vfs.provider.FileReplicator;
  -import org.apache.aut.vfs.provider.FileSystemProvider;
  -import org.apache.aut.vfs.provider.LocalFileSystemProvider;
  +import org.apache.aut.vfs.provider.FileProvider;
  +import org.apache.aut.vfs.provider.LocalFileProvider;
   import org.apache.aut.vfs.provider.UriParser;
   import org.apache.avalon.excalibur.i18n.ResourceManager;
   import org.apache.avalon.excalibur.i18n.Resources;
  @@ -45,12 +45,12 @@
           = ResourceManager.getPackageResources( DefaultFileSystemManager.class );
   
       /** The provider for local files. */
  -    private LocalFileSystemProvider m_localFileProvider;
  +    private LocalFileProvider m_localFileProvider;
   
       /** The file replicator to use. */
       private final DefaultFileReplicator m_fileReplicator = new DefaultFileReplicator( this
);
   
  -    /** Mapping from URI scheme to FileSystemProvider. */
  +    /** Mapping from URI scheme to FileProvider. */
       private final Map m_providers = new HashMap();
   
       /** The base file to use for relative URI. */
  @@ -63,7 +63,7 @@
        * Registers a file system provider.
        */
       public void addProvider( final String urlScheme,
  -                             final FileSystemProvider provider )
  +                             final FileProvider provider )
           throws FileSystemException
       {
           addProvider( new String[]{urlScheme}, provider );
  @@ -73,7 +73,7 @@
        * Registers a file system provider.
        */
       public void addProvider( final String[] urlSchemes,
  -                             final FileSystemProvider provider )
  +                             final FileProvider provider )
           throws FileSystemException
       {
           // Check for duplicates
  @@ -98,9 +98,9 @@
               m_providers.put( scheme, provider );
           }
   
  -        if( provider instanceof LocalFileSystemProvider )
  +        if( provider instanceof LocalFileProvider )
           {
  -            m_localFileProvider = (LocalFileSystemProvider)provider;
  +            m_localFileProvider = (LocalFileProvider)provider;
           }
       }
   
  @@ -201,7 +201,7 @@
           if( scheme != null )
           {
               // An absolute URI - locate the provider
  -            final FileSystemProvider provider = (FileSystemProvider)m_providers.get( scheme
);
  +            final FileProvider provider = (FileProvider)m_providers.get( scheme );
               if( provider != null )
               {
                   return provider.findFile( baseFile, uri );
  @@ -250,7 +250,7 @@
                                           final FileObject file )
           throws FileSystemException
       {
  -        FileSystemProvider provider = (FileSystemProvider)m_providers.get( scheme );
  +        FileProvider provider = (FileProvider)m_providers.get( scheme );
           if( provider == null )
           {
               final String message = REZ.getString( "unknown-provider.error", scheme );
  @@ -262,7 +262,7 @@
       /**
        * Locates the local file provider.
        */
  -    private LocalFileSystemProvider getLocalFileProvider()
  +    private LocalFileProvider getLocalFileProvider()
           throws FileSystemException
       {
           if( m_localFileProvider == null )
  @@ -286,7 +286,7 @@
       {
           public URLStreamHandler createURLStreamHandler( final String protocol )
           {
  -            final FileSystemProvider provider = (FileSystemProvider)m_providers.get( protocol
);
  +            final FileProvider provider = (FileProvider)m_providers.get( protocol );
               if( provider != null )
               {
                   return new DefaultURLStreamHandler( m_context );
  
  
  
  1.8       +3 -23     jakarta-ant-myrmidon/aut/src/java/org/apache/aut/vfs/provider/AbstractFileSystemProvider.java
  
  Index: AbstractFileSystemProvider.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/aut/src/java/org/apache/aut/vfs/provider/AbstractFileSystemProvider.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- AbstractFileSystemProvider.java	7 Apr 2002 02:27:56 -0000	1.7
  +++ AbstractFileSystemProvider.java	17 Jun 2002 07:19:45 -0000	1.8
  @@ -15,7 +15,6 @@
   import org.apache.avalon.excalibur.i18n.ResourceManager;
   import org.apache.avalon.excalibur.i18n.Resources;
   import org.apache.avalon.framework.activity.Disposable;
  -import org.apache.avalon.framework.logger.AbstractLogEnabled;
   
   /**
    * A partial file system provider implementation.
  @@ -24,36 +23,17 @@
    * @version $Revision$ $Date$
    */
   public abstract class AbstractFileSystemProvider
  -    extends AbstractLogEnabled
  -    implements FileSystemProvider, Disposable
  +    extends AbstractFileProvider
  +    implements Disposable
   {
       private static final Resources REZ =
           ResourceManager.getPackageResources( AbstractFileSystemProvider.class );
   
  -    private FileSystemProviderContext m_context;
  -
       /**
        * The cached file systems.  This is a mapping from root URI to
        * FileSystem object.
        */
       private final Map m_fileSystems = new HashMap();
  -
  -    /**
  -     * Returns the context for this provider.
  -     */
  -    protected FileSystemProviderContext getContext()
  -    {
  -        return m_context;
  -    }
  -
  -    /**
  -     * Sets the context for this file system provider.  This method is called
  -     * before any of the other provider methods.
  -     */
  -    public void setContext( final FileSystemProviderContext context )
  -    {
  -        m_context = context;
  -    }
   
       /**
        * Closes the file systems created by this provider.
  
  
  
  1.1                  jakarta-ant-myrmidon/aut/src/java/org/apache/aut/vfs/provider/AbstractFileProvider.java
  
  Index: AbstractFileProvider.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE.txt file.
   */
  package org.apache.aut.vfs.provider;
  
  import org.apache.avalon.framework.logger.AbstractLogEnabled;
  
  /**
   * A partial FileProvider implementation.
   *
   * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a>
   * @version $Revision: 1.1 $ $Date: 2002/06/17 07:19:45 $
   */
  public abstract class AbstractFileProvider
      extends AbstractLogEnabled
      implements FileProvider
  {
      private FileSystemProviderContext m_context;
  
      /**
       * Returns the context for this provider.
       */
      protected FileSystemProviderContext getContext()
      {
          return m_context;
      }
  
      /**
       * Sets the context for this file system provider.  This method is called
       * before any of the other provider methods.
       */
      public void setContext( final FileSystemProviderContext context )
      {
          m_context = context;
      }
  }
  
  
  
  1.1                  jakarta-ant-myrmidon/aut/src/java/org/apache/aut/vfs/provider/FileProvider.java
  
  Index: FileProvider.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE.txt file.
   */
  package org.apache.aut.vfs.provider;
  
  import org.apache.aut.vfs.FileObject;
  import org.apache.aut.vfs.FileSystemException;
  
  /**
   * A file provider.  Each file provider is responsible for handling files for
   * a particular URI scheme.
   *
   * <p>A provider may implement the LogEnabled and Disposable interfaces
   * from Avalon.
   *
   * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a>
   * @version $Revision: 1.1 $ $Date: 2002/06/17 07:19:45 $
   *
   * @ant.role name="file-provider"
   */
  public interface FileProvider
  {
      String ROLE = FileProvider.class.getName();
  
      /**
       * Sets the context for this file provider.  This method is called before
       * any of the other provider methods.
       *
       * @todo - move this to a lifecycle interface (this interface is accessable
       * to other providers, so need to prevent this being called).
       */
      void setContext( FileSystemProviderContext context );
  
      /**
       * Locates a file object, by absolute URI.
       *
       * @param baseFile
       *          The base file to use for resolving the individual parts of
       *          a compound URI.
       * @param uri
       *          The absolute URI of the file to find.
       */
      FileObject findFile( FileObject baseFile, String uri )
          throws FileSystemException;
  
      /**
       * Creates a layered file system.
       *
       * @param scheme
       *          The URI scheme for the layered file system.
       * @param file
       *          The file to build the file system on.
       */
      FileObject createFileSystem( String scheme, FileObject file )
          throws FileSystemException;
  }
  
  
  
  1.1                  jakarta-ant-myrmidon/aut/src/java/org/apache/aut/vfs/provider/LocalFileProvider.java
  
  Index: LocalFileProvider.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included  with this distribution in
   * the LICENSE.txt file.
   */
  package org.apache.aut.vfs.provider;
  
  import java.io.File;
  import org.apache.aut.vfs.FileObject;
  import org.apache.aut.vfs.FileSystemException;
  
  /**
   * A file provider which handles local files.
   *
   * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a>
   * @version $Revision: 1.1 $ $Date: 2002/06/17 07:19:45 $
   */
  public interface LocalFileProvider
      extends FileProvider
  {
      /**
       * Determines if a name is an absolute file name.
       *
       * @todo Move this to a general file name parser interface.
       *
       * @param name The name to test.
       */
      boolean isAbsoluteLocalName( final String name );
  
      /**
       * Finds a local file, from its local name.
       */
      FileObject findLocalFile( final String name )
          throws FileSystemException;
  
      /**
       * Converts from java.io.File to FileObject.
       */
      FileObject findLocalFile( final File file )
          throws FileSystemException;
  }
  
  
  
  1.5       +2 -2      jakarta-ant-myrmidon/aut/src/java/org/apache/aut/vfs/provider/ftp/FtpFileSystemProvider.java
  
  Index: FtpFileSystemProvider.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/aut/src/java/org/apache/aut/vfs/provider/ftp/FtpFileSystemProvider.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- FtpFileSystemProvider.java	7 Apr 2002 02:27:57 -0000	1.4
  +++ FtpFileSystemProvider.java	17 Jun 2002 07:19:45 -0000	1.5
  @@ -21,7 +21,7 @@
    * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a>
    * @version $Revision$ $Date$
    *
  - * @ant.type type="file-system" name="ftp"
  + * @ant.type type="file-provider" name="ftp"
    */
   public class FtpFileSystemProvider extends AbstractFileSystemProvider
   {
  
  
  
  1.2       +4 -4      jakarta-ant-myrmidon/aut/src/java/org/apache/aut/vfs/provider/local/DefaultLocalFileSystemProvider.java
  
  Index: DefaultLocalFileSystemProvider.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/aut/src/java/org/apache/aut/vfs/provider/local/DefaultLocalFileSystemProvider.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DefaultLocalFileSystemProvider.java	7 Apr 2002 02:27:57 -0000	1.1
  +++ DefaultLocalFileSystemProvider.java	17 Jun 2002 07:19:45 -0000	1.2
  @@ -14,7 +14,7 @@
   import org.apache.aut.vfs.provider.AbstractFileSystemProvider;
   import org.apache.aut.vfs.provider.DefaultFileName;
   import org.apache.aut.vfs.provider.FileSystem;
  -import org.apache.aut.vfs.provider.LocalFileSystemProvider;
  +import org.apache.aut.vfs.provider.LocalFileProvider;
   import org.apache.aut.vfs.provider.ParsedUri;
   
   /**
  @@ -23,12 +23,12 @@
    * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a>
    * @version $Revision$ $Date$
    *
  - * @ant.type type="file-system" name="file"
  + * @ant.type type="file-provider" name="file"
    *
    */
   public class DefaultLocalFileSystemProvider
       extends AbstractFileSystemProvider
  -    implements LocalFileSystemProvider
  +    implements LocalFileProvider
   {
       private final LocalFileNameParser m_parser;
   
  
  
  
  1.5       +4 -4      jakarta-ant-myrmidon/aut/src/java/org/apache/aut/vfs/provider/smb/SmbFileSystemProvider.java
  
  Index: SmbFileSystemProvider.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/aut/src/java/org/apache/aut/vfs/provider/smb/SmbFileSystemProvider.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- SmbFileSystemProvider.java	7 Apr 2002 02:27:57 -0000	1.4
  +++ SmbFileSystemProvider.java	17 Jun 2002 07:19:45 -0000	1.5
  @@ -13,7 +13,7 @@
   import org.apache.aut.vfs.provider.AbstractFileSystemProvider;
   import org.apache.aut.vfs.provider.DefaultFileName;
   import org.apache.aut.vfs.provider.FileSystem;
  -import org.apache.aut.vfs.provider.FileSystemProvider;
  +import org.apache.aut.vfs.provider.FileProvider;
   import org.apache.aut.vfs.provider.ParsedUri;
   
   /**
  @@ -22,9 +22,9 @@
    * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a>
    * @version $Revision$ $Date$
    *
  - * @ant.type type="file-system" name="smb"
  + * @ant.type type="file-provider" name="smb"
    */
  -public class SmbFileSystemProvider extends AbstractFileSystemProvider implements FileSystemProvider
  +public class SmbFileSystemProvider extends AbstractFileSystemProvider implements FileProvider
   {
       private final SmbFileNameParser m_parser = new SmbFileNameParser();
   
  
  
  
  1.5       +4 -4      jakarta-ant-myrmidon/aut/src/java/org/apache/aut/vfs/provider/zip/ZipFileSystemProvider.java
  
  Index: ZipFileSystemProvider.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/aut/src/java/org/apache/aut/vfs/provider/zip/ZipFileSystemProvider.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ZipFileSystemProvider.java	7 Apr 2002 02:27:57 -0000	1.4
  +++ ZipFileSystemProvider.java	17 Jun 2002 07:19:46 -0000	1.5
  @@ -14,7 +14,7 @@
   import org.apache.aut.vfs.provider.AbstractFileSystemProvider;
   import org.apache.aut.vfs.provider.DefaultFileName;
   import org.apache.aut.vfs.provider.FileSystem;
  -import org.apache.aut.vfs.provider.FileSystemProvider;
  +import org.apache.aut.vfs.provider.FileProvider;
   import org.apache.aut.vfs.provider.ParsedUri;
   
   /**
  @@ -24,11 +24,11 @@
    * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a>
    * @version $Revision$ $Date$
    *
  - * @ant.type type="file-system" name="zip"
  + * @ant.type type="file-provider" name="zip"
    */
   public class ZipFileSystemProvider
       extends AbstractFileSystemProvider
  -    implements FileSystemProvider
  +    implements FileProvider
   {
       private final ZipFileNameParser m_parser = new ZipFileNameParser();
   
  
  
  

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


Mime
View raw message