Sorry, I think I misunderstood your patch reading the diff.
I now looked at it much better and I see the change.
The main difference is that previously an illegal path was encapsulated
in a FileNotFoundException while after your patch it passes as an
IllegalArgumentException.
Not sure if this can create more or less problems: I don't have the time
to review all the callers to understand wether this improve or not the
current logging/behaviour, but maybe I would prefer to switch to the old
behaviour, maybe throwing a ContextException from AvalonContextUtilities
instead of the illegalArgumentException (so that it get cought by
AvalonFileSystem).
WDYT?
Stefano
Norman Maurer wrote:
i thought we always use the AvolonFileSystem so it throw only
FileNotFoundException... Im wrong ?
bye
Norman
Stefano Bagnara schrieb:
[EMAIL PROTECTED] wrote:
Author: norman
Date: Sat Oct 7 10:58:04 2006
New Revision: 453971
URL: http://svn.apache.org/viewvc?view=rev&rev=453971
Log:
Change the throwed Exception to the "right" one..
Uh? I did the refactoring to remove
Context/Contextualize/ContextException from the
visibilities/dependencies of other components: thet shouldn't get the
ContextException.
ContextException is not the right one but simply what the
AvalonContextUtilities throw.
I'm -1 to this patch.
At most we could introduce a FileSystemException but I think we can
live with the FileNotFoundException as we are simply asking for a File.
Stefano
Modified:
james/server/trunk/src/java/org/apache/james/context/AvalonContextUtilities.java
james/server/trunk/src/java/org/apache/james/context/AvalonFileSystem.java
Modified:
james/server/trunk/src/java/org/apache/james/context/AvalonContextUtilities.java
URL:
http://svn.apache.org/viewvc/james/server/trunk/src/java/org/apache/james/context/AvalonContextUtilities.java?view=diff&rev=453971&r1=453970&r2=453971
==============================================================================
---
james/server/trunk/src/java/org/apache/james/context/AvalonContextUtilities.java
(original)
+++
james/server/trunk/src/java/org/apache/james/context/AvalonContextUtilities.java
Sat Oct 7 10:58:04 2006
@@ -55,7 +55,7 @@
* application home, unless it begins with a
slash. In
* the latter case the file location is evaluated
relative
* to the underlying file system root.
- *
+ * * @throws IllegalArgumentException if
the arguments are null or the file
* URL is not appropriately
formatted.
* @throws ContextException if the underlying context generates a
@@ -63,8 +63,7 @@
* not correct, or if an IOException is
generated
* while accessing the file.
*/
- public static File getFile(Context context, String fileURL)
- throws Exception {
+ public static File getFile(Context context, String fileURL)
throws ContextException {
if ((context == null) || (fileURL == null)) {
throw new IllegalArgumentException("The getFile method
doesn't allow null arguments.");
}
Modified:
james/server/trunk/src/java/org/apache/james/context/AvalonFileSystem.java
URL:
http://svn.apache.org/viewvc/james/server/trunk/src/java/org/apache/james/context/AvalonFileSystem.java?view=diff&rev=453971&r1=453970&r2=453971
==============================================================================
---
james/server/trunk/src/java/org/apache/james/context/AvalonFileSystem.java
(original)
+++
james/server/trunk/src/java/org/apache/james/context/AvalonFileSystem.java
Sat Oct 7 10:58:04 2006
@@ -47,8 +47,6 @@
return AvalonContextUtilities.getFile(context, fileURL);
} catch (ContextException e) {
throw new FileNotFoundException("Context exception:
"+e.getMessage());
- } catch (Exception e) {
- throw new FileNotFoundException(e.getMessage());
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
!EXCUBATOR:1,452806bc53073488419935!
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]