commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From adammurd...@apache.org
Subject cvs commit: jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/impl DefaultFileSystemManager.java
Date Mon, 25 Nov 2002 05:30:59 GMT
adammurdoch    2002/11/24 21:30:59

  Modified:    vfs/src/java/org/apache/commons/vfs Resources.properties
               vfs/src/java/org/apache/commons/vfs/impl
                        DefaultFileSystemManager.java
  Log:
  Write warning to log when multiple providers are registered for the same URL scheme, instead
  of throwing exception.
  
  Revision  Changes    Path
  1.14      +5 -1      jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/Resources.properties
  
  Index: Resources.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/Resources.properties,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- Resources.properties	23 Nov 2002 00:01:58 -0000	1.13
  +++ Resources.properties	25 Nov 2002 05:30:59 -0000	1.14
  @@ -30,6 +30,7 @@
   vfs.provider/find-files.error=Could not find files in "{0}".
   vfs.provider/check-is-writeable.error=Could not determine if file "{0}" is writeable.
   vfs.provider/check-is-readable.error=Could not determine if file "{0}" is readable.
  +vfs.provider/get-url.error=Could not create URL for "{0}".
   
   # DefaultFileContent
   vfs.provider/get-size-folder.error=Could not determine the size of "{0}" because it is
a folder.
  @@ -73,7 +74,7 @@
   # DefaultFileSystemManager
   vfs.impl/unknown-scheme.error=Unknown scheme "{0}" in URI "{1}".
   vfs.impl/find-rel-file.error=Could not find file with URI "{0}" because it is a relative
path, and no base URI was provided.
  -vfs.impl/multiple-providers-for-scheme.error=Multiple file system providers registered
for URL scheme "{0}".
  +vfs.impl/multiple-providers-for-scheme.warning=Multiple providers registered for URL scheme
"{0}".
   vfs.impl/unknown-provider.error=No file system provider is registered for URI scheme "{0}".
   vfs.impl/no-local-file-provider.error=Could not find a file system provider which can handle
local files.
   vfs.impl/no-replicator.error=No file replicator configured.
  @@ -121,6 +122,9 @@
   vfs.provider.ftp/set-binary.error=Could not switch to binary transfer mode.
   vfs.provider.ftp/connect.error=Could not connect to FTP server on "{0}".
   vfs.provider.ftp/close-connection.error=Could not close connection to FTP server.
  +
  +# URL Provider
  +vfs.provider.url/badly-formed-uri.error=Badly formed URI "{0}".
   
   # Ant tasks
   vfs.tasks/sync.no-destination.error=No destination file or directory specified.
  
  
  
  1.18      +4 -2      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.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- DefaultFileSystemManager.java	23 Nov 2002 00:33:52 -0000	1.17
  +++ DefaultFileSystemManager.java	25 Nov 2002 05:30:59 -0000	1.18
  @@ -67,6 +67,7 @@
   import org.apache.commons.vfs.FileObject;
   import org.apache.commons.vfs.FileSystemException;
   import org.apache.commons.vfs.FileSystemManager;
  +import org.apache.commons.vfs.util.Messages;
   import org.apache.commons.vfs.provider.DefaultURLStreamHandler;
   import org.apache.commons.vfs.provider.FileProvider;
   import org.apache.commons.vfs.provider.FileReplicator;
  @@ -169,13 +170,14 @@
                                final FileProvider provider )
           throws FileSystemException
       {
  -        // Check for duplicates
  +        // Warn about duplicate providers
           for ( int i = 0; i < urlSchemes.length; i++ )
           {
               final String scheme = urlSchemes[ i ];
               if ( providers.containsKey( scheme ) )
               {
  -                throw new FileSystemException( "vfs.impl/multiple-providers-for-scheme.error",
scheme );
  +                final String message = Messages.getString( "vfs.impl/multiple-providers-for-scheme.warning",
scheme );
  +                getLog().warn( message );
               }
           }
   
  
  
  

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


Mime
View raw message