geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason Dillon <ja...@coredevelopers.net>
Subject Re: [core] Directories w/spaces
Date Tue, 26 Aug 2003 14:17:30 GMT
A URLEncoded string will cause URL() to puke.  And probably won't work 
with File() either.

--jason


On Tuesday, August 26, 2003, at 09:12  PM, Daniel S. Haischt wrote:

> just as a starting point (don't know whether it helps or not, tho).
>
> what about:
>
> String test1 = java.net.URLEncoder.encode(
>   "file:///Program Files/MyProgram/test.txt", "UTF-8");
> String test2 = java.net.URLDecoder.decode(
>   test1, "UTF-8");
>
> System.out.println(test1 + "\n" + test2);
>
> it would decode/encode your strings which are containing
> whitespaces.
>
> regards
>
> daniel s. haischt
> --
>
> James Strachan wrote:
>> On Tuesday, August 26, 2003, at 02:37  pm, Alex Blewitt wrote:
>>> On Tuesday, Aug 26, 2003, at 13:49 Europe/London, Jason Dillon wrote:
>>>
>>>> Looks like the deployment system is not very happy with directories 
>>>> with spaces in the path.  I looked into this some but I am stumped 
>>>> with how to fix this right now.
>>>>
>>>> URI does not like a space in its spec, but URL is just fine with 
>>>> this.  ServiceDeploymentPlanner is taking its DeployURL and turning 
>>>> it into a URI, which fails if the URL has a space.
>>>>
>>>> I tried a few hacks to get around this, but then other bits of the 
>>>> system fail from the space in the URL too.
>>>>
>>>> Is there a global solution to this problem, so we can translate a 
>>>> urlspec into a URL which will also work for a URI and not break 
>>>> reading content from file URLs too?
>>>
>>>
>>> URI spaces should be escaped into %20 IIRC. So 'new URI("Hello 
>>> World")' may fail, while 'new URI("Hello%20World")' may work. Of 
>>> course, it then depends on the URI being properly unencoded at the 
>>> other end where required.
>> Thats a HTTP thing isn't it? Doesn't work for file based URIs AFAIK.
>> James
>> -------
>> http://radio.weblogs.com/0112098/
>
>


Mime
View raw message