Package org.eclipse.osgi.storage.url
Class BundleResourceHandler
java.lang.Object
java.net.URLStreamHandler
org.eclipse.osgi.storage.url.BundleResourceHandler
URLStreamHandler the bundleentry and bundleresource protocols.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
protected BundleEntry
protected final ModuleContainer
static final String
static final String
static final String
static final String
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
BundleResourceHandler
(ModuleContainer container, BundleEntry bundleEntry) -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
checkAuthorization
(Module module) static String
createURLHostForBundleID
(ModuleContainer container, long bundleId) protected boolean
protected abstract BundleEntry
findBundleEntry
(URL url, Module module) Finds the bundle entry for this protocal.protected InetAddress
getHostAddress
(URL url) protected int
protected boolean
hostsEqual
(URL url1, URL url2) protected URLConnection
openConnection
(URL url) Establishes a connection to the resource specified byURL
.protected void
Parse reference URL.protected boolean
protected String
toExternalForm
(URL url) Converts a bundle URL to a String.Methods inherited from class java.net.URLStreamHandler
getDefaultPort, openConnection, setURL, setURL
-
Field Details
-
OSGI_RESOURCE_URL_PROTOCOL
- See Also:
-
OSGI_ENTRY_URL_PROTOCOL
- See Also:
-
SECURITY_CHECKED
- See Also:
-
SECURITY_UNCHECKED
- See Also:
-
BID_FWKID_SEPARATOR
- See Also:
-
container
-
bundleEntry
-
-
Constructor Details
-
BundleResourceHandler
-
-
Method Details
-
parseURL
Parse reference URL.- Overrides:
parseURL
in classURLStreamHandler
-
openConnection
Establishes a connection to the resource specified byURL
. Since different protocols may have unique ways of connecting, it must be overridden by the subclass.- Specified by:
openConnection
in classURLStreamHandler
- Parameters:
url
- java.net.URL- Returns:
- java.net.URLConnection
- Throws:
IOException
- thrown if an IO error occurs during connection establishment
-
findBundleEntry
Finds the bundle entry for this protocal. This is handled differently for Bundle.gerResource() and Bundle.getEntry() because getResource uses the bundle classloader and getEntry only used the base bundle file.- Parameters:
url
- The URL to find the entry for.module
- the module to find the entry for.- Returns:
- the bundle entry
- Throws:
IOException
-
toExternalForm
Converts a bundle URL to a String.- Overrides:
toExternalForm
in classURLStreamHandler
- Parameters:
url
- the URL.- Returns:
- a string representation of the URL.
-
hashCode
- Overrides:
hashCode
in classURLStreamHandler
-
equals
- Overrides:
equals
in classURLStreamHandler
-
getHostAddress
- Overrides:
getHostAddress
in classURLStreamHandler
-
hostsEqual
- Overrides:
hostsEqual
in classURLStreamHandler
-
sameFile
- Overrides:
sameFile
in classURLStreamHandler
-
checkAuthorization
-
createURLHostForBundleID
-