commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ima...@apache.org
Subject cvs commit: jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs FileSystemManager.java SystemInfo.java
Date Mon, 28 Jun 2004 19:44:57 GMT
imario      2004/06/28 12:44:57

  Modified:    vfs/src/java/org/apache/commons/vfs/impl
                        DefaultFileSystemManager.java
               vfs/src/java/org/apache/commons/vfs FileSystemManager.java
  Removed:     vfs/src/java/org/apache/commons/vfs SystemInfo.java
  Log:
  moved SystemInfo to the FileSystemManager interface.
  Now all configuration parameters for the filesystem manager are again in a single place.
  
  Revision  Changes    Path
  1.32      +37 -26    jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/impl/DefaultFileSystemManager.java
  
  Index: DefaultFileSystemManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/impl/DefaultFileSystemManager.java,v
  retrieving revision 1.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- DefaultFileSystemManager.java	23 Jun 2004 18:17:44 -0000	1.31
  +++ DefaultFileSystemManager.java	28 Jun 2004 19:44:57 -0000	1.32
  @@ -18,11 +18,11 @@
   import org.apache.commons.logging.Log;
   import org.apache.commons.vfs.FileContentInfoFactory;
   import org.apache.commons.vfs.FileObject;
  +import org.apache.commons.vfs.FileSystemConfigBuilder;
   import org.apache.commons.vfs.FileSystemException;
   import org.apache.commons.vfs.FileSystemManager;
   import org.apache.commons.vfs.FileSystemOptions;
   import org.apache.commons.vfs.FilesCache;
  -import org.apache.commons.vfs.SystemInfo;
   import org.apache.commons.vfs.cache.DefaultFilesCache;
   import org.apache.commons.vfs.provider.DefaultURLStreamHandler;
   import org.apache.commons.vfs.provider.FileProvider;
  @@ -101,27 +101,6 @@
       private final DefaultVfsComponentContext context =
           new DefaultVfsComponentContext(this);
   
  -    private final SystemInfo vfsSystemInfo = new SystemInfo()
  -    {
  -        public String[] getSchemes()
  -        {
  -            String schemes[] = new String[providers.size()];
  -            providers.keySet().toArray(schemes);
  -            return schemes;
  -        }
  -
  -        public Collection getProviderCapabilities(String scheme) throws FileSystemException
  -        {
  -            FileProvider provider = (FileProvider) providers.get(scheme);
  -            if (provider == null)
  -            {
  -                throw new FileSystemException("vfs.impl/unknown-scheme.error", new Object[]{scheme});
  -            }
  -
  -            return provider.getCapabilities();
  -        }
  -    };
  -
       private TemporaryFileStore tempFileStore;
       private final FileTypeMap map = new FileTypeMap();
       private final VirtualFileProvider vfsProvider = new VirtualFileProvider();
  @@ -639,12 +618,44 @@
       }
   
       /**
  -     * get the system info. e.g. schemes, provider
  +     * Get the schemes currently available.
  +     */
  +    public String[] getSchemes()
  +    {
  +        String schemes[] = new String[providers.size()];
  +        providers.keySet().toArray(schemes);
  +        return schemes;
  +    }
  +
  +    /**
  +     * Get the capabilities for a given scheme.
        *
  -     * @return
  +     * @throws FileSystemException if the given scheme is not konwn
        */
  -    public SystemInfo getSystemInfo()
  +    public Collection getProviderCapabilities(final String scheme) throws FileSystemException
       {
  -        return vfsSystemInfo;
  +        FileProvider provider = (FileProvider) providers.get(scheme);
  +        if (provider == null)
  +        {
  +            throw new FileSystemException("vfs.impl/unknown-scheme.error", new Object[]{scheme});
  +        }
  +
  +        return provider.getCapabilities();
  +    }
  +
  +    /**
  +     * Get the configuration builder for the given scheme
  +     *
  +     * @throws FileSystemException if the given scheme is not konwn
  +     */
  +    public FileSystemConfigBuilder getFileSystemConfigBuilder(final String scheme) throws
FileSystemException
  +    {
  +        FileProvider provider = (FileProvider) providers.get(scheme);
  +        if (provider == null)
  +        {
  +            throw new FileSystemException("vfs.impl/unknown-scheme.error", new Object[]{scheme});
  +        }
  +
  +        return provider.getConfigBuilder();
       }
   }
  
  
  
  1.21      +25 -5     jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/FileSystemManager.java
  
  Index: FileSystemManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/FileSystemManager.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- FileSystemManager.java	23 Jun 2004 18:17:44 -0000	1.20
  +++ FileSystemManager.java	28 Jun 2004 19:44:57 -0000	1.21
  @@ -15,8 +15,11 @@
    */
   package org.apache.commons.vfs;
   
  +import org.apache.commons.logging.Log;
  +
   import java.io.File;
   import java.net.URLStreamHandlerFactory;
  +import java.util.Collection;
   
   /**
    * A FileSystemManager manages a set of file systems.  This interface is
  @@ -196,14 +199,31 @@
       FilesCache getFilesCache();
   
       /**
  -     * Gets the system info. e.g. Available schemes, provider configuration builder, ...
  +     * The class to use to determine the content-type (mime-type)
        */
  -    SystemInfo getSystemInfo();
  +    FileContentInfoFactory getFileContentInfoFactory();
   
       /**
  -     * The class to use to determine the content-type (mime-type)
  +     * Get the schemes currently available.
  +     */
  +    public String[] getSchemes();
  +
  +    /**
  +     * Get the capabilities for a given scheme.
        *
  -     * @return
  +     * @throws FileSystemException if the given scheme is not konwn
        */
  -    FileContentInfoFactory getFileContentInfoFactory();
  +    public Collection getProviderCapabilities(final String scheme) throws FileSystemException;
  +
  +    /**
  +     * Sets the logger to use.
  +     */
  +    public void setLogger(final Log log);
  +
  +    /**
  +     * Get the configuration builder for the given scheme
  +     *
  +     * @throws FileSystemException if the given scheme is not konwn
  +     */
  +    public FileSystemConfigBuilder getFileSystemConfigBuilder(final String scheme) throws
FileSystemException;
   }
  
  
  

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