cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pier Fumagalli <>
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

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

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()

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


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

View raw message