cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pier Fumagalli <p...@betaversion.org>
Subject [WEB-INF] MicroStep #1: getRealPath()
Date Fri, 31 Jan 2003 16:26:20 GMT
I see quite extensively throughout the code, the use of "getRealPath"... In
my book, this is always true:

new URL("file:" + getRealPath(x)).equals(getResource(x));

Unless I overlooked something. I don't quite remember why it wasn't
deprecated in Servlet 2.3, but definitely, to me, it doesn't make much
sense.

What if as microstep #1 we deprecated getRealPath() in favor of
getResource(), and went around in the entire code-base replacing and fixing
stuff?

Then in the getRealPath() call in both CommandlineContext and HttpContext
should become something like

public string getRealPath(String path) {
    URL url = getResource(path);
    if ("file".equals(url.getProtocol()) {
        return new File(url.getPath()).absolutePath()
    }
    return(null);
}

And would be deprecated... Is there something I _massively_ overlooked?

    Pier


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message