You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by TREGAN Fabien <fa...@airbus.com> on 2002/04/26 11:00:25 UTC

SourceFactory and URL prefixe

Hi,

Little question about URL prefixes handling in pseudo protocols :

The sitemap allow the admin to associate one (pseudo)protocol with one
SourceFactory. But looking at the sources of the BlobSource, I've found :

-> private final static String URL_PREFIX = "blob:/";
-> if (!url.startsWith("blobl:/")) {
      throw new MalformedURLException("Malformed url for a blob source : " +
url);
   }

Is it normal for a source to check the prefixe ?

Since the factory is associated with one protocol, I thought that whatever
the prefix was, it was only used to selected the proper factory, and then
the Source should'nt be aware of the prefixe.

If the factory or the source "knows" the prefixe for any reason (please,
explain), why doesn't it tell the SourceHandler the prefixes it handles
(i.e. why do youhave to tell it in the sitemap, if you can ONLY use
name="blob" ?)


fabien.

---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


RE: SourceFactory and URL prefixe

Posted by Carsten Ziegeler <cz...@s-und-n.de>.
TREGAN Fabien wrote:
>
> Hi,
>
> Little question about URL prefixes handling in pseudo protocols :
>
> The sitemap allow the admin to associate one (pseudo)protocol with one
> SourceFactory. But looking at the sources of the BlobSource, I've found :
>
> -> private final static String URL_PREFIX = "blob:/";
> -> if (!url.startsWith("blobl:/")) {
>       throw new MalformedURLException("Malformed url for a blob
> source : " +
> url);
>    }
>
> Is it normal for a source to check the prefixe ?
>
> Since the factory is associated with one protocol, I thought that whatever
> the prefix was, it was only used to selected the proper factory, and then
> the Source should'nt be aware of the prefixe.
>
> If the factory or the source "knows" the prefixe for any reason (please,
> explain), why doesn't it tell the SourceHandler the prefixes it handles
> (i.e. why do youhave to tell it in the sitemap, if you can ONLY use
> name="blob" ?)
>
>
You are right, the source or source factory should not assume anything about
the name of the protocol. This is a configuration detail.
Therefore the BlobSource is not implemented correctly, I will fix this asap.

Thanks,
Carsten


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>