It's been a few days now and Brian's seems the best solution. Using the replaceAll solution would mean that we'd have to include a replaceAll for any other characters in the path which get URL escaped, whereas Brian's would take care of it automatically.

One patch coming up..... (and thanks Brian)

Al.

----- Original Message ----- From: "Brian Relph" <[EMAIL PROTECTED]>
To: "Struts Developers List" <[email protected]>
Sent: Wednesday, January 23, 2008 4:00 PM
Subject: Re: WW-2452 - Need advice on fix


my junit shows it does the opposite, although i am not testing the exact
code ...

creating a file from a URI decodes the %20 along with any other utf-8
encoded characters

also, my code was html-styled, so it came out a little funny:


servletContext.setRealPath(new File(FreeMarkerResultTest.class.getResource(
"someFreeMarkerFile.ftl").toURI()).toURL().getFile());


On 1/23/08, Antonio Petrelli <[EMAIL PROTECTED]> wrote:

2008/1/23, Brian Relph <[EMAIL PROTECTED]>:
> This might be prettier -
>
> servletContext.setRealPath(*new* File(FreeMarkerResultTest.*class*
> .getResource("someFreeMarkerFile.ftl").toURI()).toURL().getFile());

Does it transform spaces into %20?

Antonio

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to