public class IlpClassLoaderURLAccessService extends Object implements IlpURLAccessService
java.net.URLClassLoader
to turn relative URLs into absolute
URLs or pathnames.
A possible use of this service is for accessing icons and configuration files.
Constructor and Description |
---|
IlpClassLoaderURLAccessService(URLClassLoader classLoader)
Creates the service.
|
Modifier and Type | Method and Description |
---|---|
URL |
getFileLocation(String filename)
Returns the URL of a file in the path, or
null if it is not found. |
URL |
getFileLocation(String filename,
boolean searchClassPathFirst,
boolean searchClassPathLast)
Returns the URL of a file in the path, or
null if it is not found. |
public IlpClassLoaderURLAccessService(URLClassLoader classLoader)
classLoader
- the classLoader whose findResource
method will be used to resolve URLspublic URL getFileLocation(String filename)
null
if it is not found.
In this implementation, it simply calls the classloader's
findResource
method.
getFileLocation
in interface IlpURLAccessService
filename
- A relative URL or pathname.public URL getFileLocation(String filename, boolean searchClassPathFirst, boolean searchClassPathLast)
null
if it is not found.
This variant has explicit control whether the file shall be searched in the
CLASSPATH or not.getFileLocation
in interface IlpURLAccessService
filename
- A relative URL or pathname.searchClassPathFirst
- ignored in this implementationsearchClassPathLast
- ignored in this implementation© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.