|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.ungoverned.moduleloader.DefaultURLPolicy
public class DefaultURLPolicy
This class implements a simple URLPolicy that the ModuleManager uses if the application does not specify one. This implementation always returns null for CodeSource URLs, which means that security is simply ignored. For resource URLs, it returns an URL in the form of:
module://<module-id>/<resource-path>
In order to properly handle the "module:" protocol, this policy also defines a custom java.net.URLStreamHandler that it assigns to each URL as it is created. This custom handler is used to return a custom java.net.URLConnection that will correctly parse the above URL and retrieve the associated resource bytes using methods from ModuleManager and Module.
ModuleManager
,
Module
,
URLPolicy
Constructor Summary | |
---|---|
DefaultURLPolicy()
|
Method Summary | |
---|---|
java.net.URL |
createCodeSourceURL(ModuleManager mgr,
Module module)
This method is a stub and always returns null. |
java.net.URL |
createResourceURL(ModuleManager mgr,
Module module,
int rsIdx,
java.lang.String name)
This method returns a URL that is suitable for accessing the bytes of the specified resource. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultURLPolicy()
Method Detail |
---|
public java.net.URL createCodeSourceURL(ModuleManager mgr, Module module)
This method is a stub and always returns null.
createCodeSourceURL
in interface URLPolicy
mgr
- the ModuleManager of the module.module
- the module for which the URL is to be created.
public java.net.URL createResourceURL(ModuleManager mgr, Module module, int rsIdx, java.lang.String name)
This method returns a URL that is suitable for accessing the bytes of the specified resource.
createResourceURL
in interface URLPolicy
mgr
- the ModuleManager of the module.module
- the module for which the resource is being loaded.rsIdx
- the index of the ResourceSource containing the resource.name
- the name of the resource being loaded.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |