commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David BERNARD <dwa...@freesurf.fr>
Subject [VFS] remove dependecies
Date Fri, 04 Oct 2002 17:16:02 GMT
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:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message