|
JPF 0.10 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.java.plugin.standard.StandardPathResolver
Standard simple implementation of path resolver. For resolving it uses
plug-in element registration (see registerContext(Identity, URL)
)
procedure.
Field Summary | |
protected org.apache.commons.logging.Log |
log
|
Constructor Summary | |
StandardPathResolver()
|
Method Summary | |
void |
configure(ExtendedProperties config)
No configuration parameters expected in this implementation. |
java.net.URL |
getRegisteredContext(java.lang.String id)
Returns URL of registered plug-in
element context. |
boolean |
isContextRegistered(java.lang.String id)
|
boolean |
isResourceExists(java.net.URL url)
Should check if resource exists and can be opened. |
void |
registerContext(Identity idt,
java.net.URL url)
This implementation accepts PluginDescriptor or
PluginFragment as valid plug-in elements. |
java.net.URL |
resolvePath(Identity identity,
java.lang.String path)
Should resolve given path to URL for a given identity. |
protected java.net.URL |
resolvePath(java.net.URL baseUrl,
java.lang.String path)
Resolves given path against given base URL. |
void |
unregisterContext(java.lang.String id)
Unregisters plug-in element from this path resolver. |
java.io.File |
url2file(java.net.URL url)
Utility method to convert local URL to a File object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected org.apache.commons.logging.Log log
Constructor Detail |
public StandardPathResolver()
Method Detail |
public void registerContext(Identity idt, java.net.URL url)
PluginDescriptor
or
PluginFragment
as valid plug-in elements.
registerContext
in interface PathResolver
idt
- plug-in elementurl
- "home" URL for a given plug-in elementPathResolver.registerContext(
org.java.plugin.registry.Identity, java.net.URL)
public void unregisterContext(java.lang.String id)
PathResolver
unregisterContext
in interface PathResolver
id
- plug-in element identifierPathResolver.unregisterContext(java.lang.String)
public java.net.URL resolvePath(Identity identity, java.lang.String path)
PathResolver
resolvePath
in interface PathResolver
identity
- plug-in element for which to resolve pathpath
- path to be resolved
PathResolver.resolvePath(
org.java.plugin.registry.Identity, java.lang.String)
public java.net.URL getRegisteredContext(java.lang.String id)
PathResolver
registered
plug-in
element context. If context for plug-in element with given ID not
registered, this method should throw an IllegalArgumentException
.
In other words, this method shouldn't return null
.
getRegisteredContext
in interface PathResolver
id
- plug-in element identifier
PathResolver.getRegisteredContext(java.lang.String)
public boolean isContextRegistered(java.lang.String id)
isContextRegistered
in interface PathResolver
id
- plug-in element identifier
true
if context for plug-in element with given ID
registeredPathResolver.isContextRegistered(java.lang.String)
protected java.net.URL resolvePath(java.net.URL baseUrl, java.lang.String path)
baseUrl
- base URL to resolve given pathpath
- path to be resolved
public void configure(ExtendedProperties config) throws java.lang.Exception
configure
in interface PathResolver
config
- path resolver configuration data
java.lang.Exception
- if any error has occurredPathResolver.configure(ExtendedProperties)
public boolean isResourceExists(java.net.URL url)
PathResolver
isResourceExists
in interface PathResolver
url
- absolute URL which points to a resource to be checked
true
if given URL points to an existing resourcepublic java.io.File url2file(java.net.URL url)
PathResolver
File
object.
url2file
in interface PathResolver
url
- an URL
null
if URL is not
local
|
JPF 0.10 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |