felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stuart McCulloch <mccu...@gmail.com>
Subject Re: Why reference: scheme is supported only for file URLs?
Date Sun, 07 Jun 2009 13:50:14 GMT
2009/6/7 Sahoo <Sahoo@sun.com>

> Hi,
>
> I see the following code in BundleArchive.java:
>           // Check if the location string represents a reference URL.
>           if ((location != null) &&
> location.startsWith(REFERENCE_PROTOCOL))
>           {
>               // Reference URLs only support the file protocol.
>               location = location.substring(REFERENCE_PROTOCOL.length());
>               if (!location.startsWith(FILE_PROTOCOL))
>               {
>                   throw new IOException("Reference URLs can only be files:
> " + location);
>               }
>            ...
>
> Why does reference: scheme only work if the underlying URL represents a
> file? Can't the code assume that for all other protocols, the underlying
> stream is a JarInputStream and proceed from there?
>

how would you use a non-file URL "in-place"? you'd need some way to convert
it to a file location
otherwise you'd have to copy the stream, which would defeat the purpose of
using "reference:"

Thanks,
> Sahoo
>

-- 
Cheers, Stuart

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message