cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anil <anilksha...@btinternet.com>
Subject Re: cocoon.context.getRealPath & cocoon 2.2
Date Tue, 22 Jan 2008 16:45:10 GMT


Hi Grzegorz -

No problem - I'll create a basic block & submit the bug.

One other thing we had noticed during our investigations was that although
the return value of the getRealPath() method contains a scheme (i.e.
file://) and therefore I assumed it was a URI, we realised that the output
was not encoded in any way.

We found that spaces were preserved as a colleague had a directroy path of
c:\foo\bah\cocoon 2.2\

Anyway, I'll submit a bug with all of these details.

Many thanks,
Anil.


Grzegorz Kossakowski-3 wrote:
> 
> anil pisze:
>> 
>> Hi -
>> 
>> Just to update this posting with my investigations - I've managed to
>> extract
>> the file contents within my spring bean.
>> 
>> The basic problem was the way I was creating the file object - the path
>> returned by the cocoon.context.getRealPath() method was a URI & when
>> instantiating my File object I needed to create a URI object first.
>> 
>> Therefore it was:
>> 
>> URI fileURI = new URI("<output of cocoon.context.getRealPath>");
>> File file = new File(fileURI);
>> 
>> rather than just new File("<output of cocoon.context.getRealPath>");
>> 
>> Sorry - I should have noticed this - I assumed that I should be able to
>> pass
>> the abstract path into File object directly - I blame it on the late
>> nights!
>> 
>> One thing I still don't really understand though is that I'm still unable
>> to
>> get a path to the resource that I want to access through my spring bean
>> as
>> cocoon.context.getRealPath("xqy/test.xqy") still returns null. In order
>> to
>> get round this I do:
>> 
>> var fullPath = cocoon.context.getRealPath("/") + "xqy/test.xqy";
>> 
>> If anyone could clear up that confusion I'd be very grateful.
> 
> It looks like a bug. Submit a bug report, please. It would be the best if
> you could create a simple
> block exhibiting this problem and attach to the issue (this will shorten a
> time needed for devs to
> take a look at it for sure) but it's not a requirement of course.
> 
> -- 
> Grzegorz Kossakowski
> Committer and PMC Member of Apache Cocoon
> http://reflectingonthevicissitudes.wordpress.com/
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/cocoon.context.getRealPath---cocoon-2.2-tp14818755p15022646.html
Sent from the Cocoon - Users mailing list archive at Nabble.com.


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


Mime
View raw message