cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bernhard Huber" <>
Subject BUG 5060, CommandlineContext
Date Sat, 29 Dec 2001 13:42:01 GMT

tried to solve BUG 5060, see

see also

As this problem only appears in the commandline environment, I check

I think that the implementation of getResource, and getRealPath of 
CommandlineContext is wrong.
I want to replace it by:
     * Constructs a CommandlineContext object from a ServletContext object
    public CommandlineContext (String contextDir) {
        String contextDirPath = new File(contextDir).getAbsolutePath();
        this.contextDir = contextDirPath;
        this.attributes = new HashMap();
    public URL getResource(String path) throws MalformedURLException {
        getLogger().debug("CommandlineContext: getResource=" + path);
        File f = new File( contextDir, path );
        return f.toURL();

    public String getRealPath(String path) {
        getLogger().debug("CommandlineContext: getRealPath=" + path);
        File f = new File( this.contextDir, path );
        return f.getAbsolutePath();

As I'm also writing JUnit Testcases for CommandlineContext, and 
which are not finished yet, and I will only able to test it on W2K, I 
will wait a bit, checking in the CommandlineContext changes.

As CommandlineContext is very fundamental, any objections against the 
CommandlineContext changes?

bye bernhard

To unsubscribe, e-mail:
For additional commands, email:

View raw message