Re: Using Jakarta Configuration with Merlin

Niclas Hedhman <[email protected]>
Newsgroups gmane.comp.jakarta.avalon.user
Organization Private
Message-ID <[email protected]>
On Sunday 19 September 2004 10:50, Niclas Hedhman wrote:

I think I have found some clues as well...

The method below in ConfigUtils, and if 

file is = 
file:/home/niclas/temp/leangen/target/deliverables/jars/myproject-test-SNAPSHOT.jar!/conf/test.xml

and basepath = current directory

And the file:/ does not resolve isAbsolute() to true, in which case the 
compunded filename is constructed. 

HOWEVER, I can't find how this could happen from getConfiguration(), since 
'url' should not be null.

Perhaps try with latest possible version!


    public static URL getURL(String basePath, String file) throws 
MalformedURLException
    {
        File f = new File(file);
        if (f.isAbsolute())     // already absolute?
        {
            return f.toURL();
        }

        try
        {
            if (basePath == null)
            {
                return new URL(file);
            }
            else
            {
                URL base = new URL(basePath);
                return new URL(base, file);
            }
        }
        catch (MalformedURLException uex)
        {
            return constructFile(basePath, file).toURL();
        }
    }

-- 
   +------//-------------------+
  / http://www.bali.ac        /
 / http://niclas.hedhman.org / 
+------//-------------------+
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.