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 Stringprotected BundleEntryprotected final ModuleContainerstatic final Stringstatic final Stringstatic final Stringstatic final String -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBundleResourceHandler(ModuleContainer container, BundleEntry bundleEntry) -
Method Summary
Modifier and TypeMethodDescriptionprotected booleancheckAuthorization(Module module) static StringcreateURLHostForBundleID(ModuleContainer container, long bundleId) protected booleanprotected abstract BundleEntryfindBundleEntry(URL url, Module module) Finds the bundle entry for this protocal.protected InetAddressgetHostAddress(URL url) protected intprotected booleanhostsEqual(URL url1, URL url2) protected URLConnectionopenConnection(URL url) Establishes a connection to the resource specified byURL.protected voidParse reference URL.protected booleanprotected StringtoExternalForm(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:
parseURLin 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:
openConnectionin 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:
toExternalFormin classURLStreamHandler- Parameters:
url- the URL.- Returns:
- a string representation of the URL.
-
hashCode
- Overrides:
hashCodein classURLStreamHandler
-
equals
- Overrides:
equalsin classURLStreamHandler
-
getHostAddress
- Overrides:
getHostAddressin classURLStreamHandler
-
hostsEqual
- Overrides:
hostsEqualin classURLStreamHandler
-
sameFile
- Overrides:
sameFilein classURLStreamHandler
-
checkAuthorization
-
createURLHostForBundleID
-