public class IlvResourceClassResolver extends Object implements IlvURLResolver
Constructor and Description |
---|
IlvResourceClassResolver(Class resourceClass)
Creates an
IlvResourceClassResolver instance that resolves
class resources from the specified resourceClass . |
IlvResourceClassResolver(Class resourceClass,
String relativePath)
Creates an
IlvResourceClassResolver that resolves
class resources from the specified resourceClass class and
by prepending the specified relativePath to the file names
to resolve. |
Modifier and Type | Method and Description |
---|---|
String |
getAbbreviateForm(URL url)
Returns the abbreviated form of the specified
url . |
String |
getRelativePath()
Returns the relative path that is prepended to the path to resolve before
getting the class resource URL.
|
Class |
getResourceClass()
Returns the class that is used by this URL resolver to retrieve
resource URLs from.
|
URL |
resolveURL(String file)
Resolves a resource class URL from the specified
file . |
public IlvResourceClassResolver(Class resourceClass)
IlvResourceClassResolver
instance that resolves
class resources from the specified resourceClass
.resourceClass
- The class to get resource URLs from.public IlvResourceClassResolver(Class resourceClass, String relativePath)
IlvResourceClassResolver
that resolves
class resources from the specified resourceClass
class and
by prepending the specified relativePath
to the file names
to resolve.resourceClass
- The class to get a resource URL from.relativePath
- The relative path to apply to the path to resolve.public URL resolveURL(String file)
file
.resolveURL
in interface IlvURLResolver
file
- The file name or relative pathname expression
to retrieve a URL from.filename
or
null
if no URL could be resolved.public String getAbbreviateForm(URL url)
url
. If the URL
is returned by the resolveURL(java.lang.String)
method, the abbreviated form should
be the file name given as the parameter of the resolveURL(java.lang.String)
method.getAbbreviateForm
in interface IlvURLResolver
url
- The URL to retrieve the abbreviated form from.url
.public Class getResourceClass()
public String getRelativePath()
IlvResourceClassResolver(Class, String)
© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.