You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by David BERNARD <dw...@freesurf.fr> on 2002/10/04 19:16:02 UTC

[VFS] remove dependecies

Hi,
May be a stupid suggestion but :

1. Dependence of commons-io could be remove by adding few line to
AbstractFileObject.

2. Dependence of excalibur-i18n could be remove by removing used of
Resource in exception. IMHO it was a bad practice,
 - the selected language is always the default locale (bad if exception
are raise on a server)
 - to provide other translation the user need to make a similar
directory structure, or to unjar, add, jar the lib.

So there isn't really internationalization. As replacement, I suggest to
:
 - add Exception.code as a key (like those in REZ)
 - add Exception.infos, an array of String that contains the arguments
 - set Exception.message = "Exception.code{Exception.infos[0],
Exception.infos[1], ...}"
 - provide a properties file that merged all Ressources.prop, but don't
use it in VFS only provide for user who want to humanize message.

By sample
final String message =
REZ.getString("set-attribute-not-supported.error");
throw new FileSystemException( message );

become
throw new FileSystemException("set-attribute-not-supported.error");

AND

final String message = REZ.getString( "list-children.error", name );
throw new FileSystemException( message, exc );

become
throw new FileSystemException( "list-children.error", name, exc);

And IMO, for FileType the use of Resources as constant is very
dangerous.

If you are OK, I could provide a patch for all those modifications.

-- 
*---------------------------------------------------------*
| Contrary to popular belief, UNIX is user-friendly. It   |
| just happens to be selective on who it makes friendship |
| with.                                                   |
|                       - Richard Cook                    |
*---------------------------------------------------------*


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>