cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Santiago Gala <>
Subject Re: [C2] How to create a disk path from the URL ?
Date Mon, 09 Apr 2001 10:47:01 GMT
Igor Romanov wrote:

> Hello Giacomo,
> GP> In the setup method you usually do a:
> GP>     InputSource src = resolver.resolveEntity(null, src);
> GP>     String      systemID = src.getSystemId();
> GP> You get the external form of an URL of the src attribute in variable
> GP> systemID.
> thanks. doesn't work (as I was expecting 8))
> Say i have <img src="/images/1.gif"/> - then I want to have
> "d:/hosting/mysite/images/1.gif" to be able to open image and
> determine it's size, but I got only "file:/images/1.gif" after
> that manipulations 8( Where's the context stored? How to get this
> "D:/bla-bla-bla" prefix while inside the transformer?
> GP> Giacomo

To manipulate URLs as files is, generally speaking A Bad Thing (TM) :)

This is because it spoils efforts to abstract your webapp so that it can 
run distributed or without unpacking the war file.

For what you want, the getContent() method (or getContent(class[]) ) in should return you the image as an object. You could try to 
use these methods and then use the Image methods to get the width and 
height of the image. The java runtime is supposed to get your image, 
without taking into account if it is stored in a file, inside a war or 
coming from a http (or other protocol) connection from a image server.

That's the theory, at least.

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

View raw message