Author: imario
Date: Wed Mar  8 07:08:03 2006
New Revision: 384229

URL: http://svn.apache.org/viewcvs?rev=384229&view=rev
Log:
allow custom FileSystemExceptions

Modified:
    
jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/FileSystemException.java

Modified: 
jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/FileSystemException.java
URL: 
http://svn.apache.org/viewcvs/jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/FileSystemException.java?rev=384229&r1=384228&r2=384229&view=diff
==============================================================================
--- 
jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/FileSystemException.java
 (original)
+++ 
jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/FileSystemException.java
 Wed Mar  8 07:08:03 2006
@@ -25,7 +25,7 @@
  * @author <a href="mailto:[EMAIL PROTECTED]">Adam Murdoch</a>
  * @version $Revision$ $Date$
  */
-public final class FileSystemException
+public class FileSystemException
     extends IOException
 {
     /**
@@ -92,6 +92,17 @@
     /**
      * Constructs exception with the specified detail message.
      *
+     * @param code the error code of the message.
+     * @param info array of complementary info (context).
+     */
+    public FileSystemException(final String code, final Throwable throwable)
+    {
+        this(code, null, throwable);
+    }
+    
+    /**
+     * Constructs exception with the specified detail message.
+     *
      * @param code      the error code of the message.
      * @param info      array of complementary info (context).
      * @param throwable the cause.
@@ -100,7 +111,7 @@
                                final Object[] info,
                                final Throwable throwable)
     {
-        super(Messages.getString(code, info));
+        super(code);
 
         if (info == null)
         {
@@ -119,6 +130,14 @@
     }
 
     /**
+     * retrieve message from bundle
+     */
+    public String getMessage()
+       {
+       return Messages.getString(super.getMessage(), getInfo());
+       }
+
+       /**
      * Constructs wrapper exception.
      *
      * @param throwable the root cause to wrap.



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to