File name resolution
Jean Morissette <[email protected]> Sun, 12 Dec 2004 23:36:58 -0500
| Newsgroups | gmane.comp.java.seda.user |
|---|---|
| Message-ID | <[email protected]> |
Hi,
Actually, 'seda.haboob.hdapi.DynamicHttp.init' retrieve a file name from
the configuration parameters (ConfigDataIF) and try to create a File
object with this name, causing a FileNotFoundException. The reason is
that the absolute path is not specified.
What should we do?
1- Let the user specify the _absolute_ path of parameters in the
configuration file. This solution mean that a configuration file would
not be "portable".
2- Let the user specify the _relative_ path of parameters in the
configuration file and provide to the user a mecanism to resolve the
file name. This is definitively the most flexible solution.
So, I suggest that the desired parameters can be relative to the actual
file.
Here is a concrete exemple:
/home/jean/my_project/haboob.cfg :
<sandstorm>
<stages>
<DynamicHttp>
class seda.haboob.hdapi.DynamicHttp
<initargs>
configfile haboob-hdapi.cfg
</initargs>
</DynamicHttp>
</stages>
</sandstorm>
Here, the parameter 'configfile' is equal to 'haboob-hdapi.cfg'. But,
we want to be able to resolve this file name. That is:
'/home/jean/my_project/haboob-hdapi.cfg'.
But, how achieve that? One possibility could be to add a standard
property name, like 'config.home', that would be equal to the absolute
configuration file or directory name. This property could be accessed
by ConfigDataIF/SandstormConfigIF getString method.
Also, we could let Sandstorm automatically preprocess the parameter, by
exemple:
<initargs>
configfile ./haboob-hdapi.cfg
</initargs>
could be transformed to '/home/jean/my_project/haboob-hdapi.cfg' before
that the user access the parameters.
Jean
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/