cocoon-dev mailing list archives

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

tried to solve BUG 5060, see

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=5060

,
see also 
http://marc.theaimsgroup.com/?l=xml-cocoon-dev&m=100866335220243&w=2

As this problem only appears in the commandline environment, I check
org.apache.cocoon.environment.commandline.CommandlineContext

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 
ResolverImpl,
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: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message