public class UrlResourceFinder extends Object implements ResourceFinder
Constructor and Description |
---|
UrlResourceFinder() |
UrlResourceFinder(URL[] urls) |
Modifier and Type | Method and Description |
---|---|
void |
addUrl(URL url) |
protected void |
addUrls(List urls)
Adds a list of urls to the end of this class loader.
|
protected void |
addUrls(URL[] urls)
Adds an array of urls to the end of this class loader.
|
protected File |
cacheUrl(URL url) |
protected ResourceLocation |
createResourceLocation(URL codeSource,
File cacheFile) |
void |
destroy() |
URL |
findResource(String resourceName)
Find the resource by name and return URL of it if found.
|
Enumeration |
findResources(String resourceName)
Find all resources with given name and return enumeration of their URLs.
|
ResourceHandle |
getResource(String resourceName)
Get the resource by name and, if found, open connection to it and return
the
handle of it. |
URL[] |
getUrls() |
public UrlResourceFinder()
public UrlResourceFinder(URL[] urls)
public void destroy()
public ResourceHandle getResource(String resourceName)
ResourceFinder
handle
of it.getResource
in interface ResourceFinder
resourceName
- the resource namepublic URL findResource(String resourceName)
ResourceFinder
findResource
in interface ResourceFinder
resourceName
- the resource namepublic Enumeration findResources(String resourceName)
ResourceFinder
findResources
in interface ResourceFinder
resourceName
- the resource namepublic void addUrl(URL url)
public URL[] getUrls()
protected void addUrls(URL[] urls)
urls
- the URLs to addprotected void addUrls(List urls)
urls
- the URLs to addprotected File cacheUrl(URL url) throws IOException
IOException
protected ResourceLocation createResourceLocation(URL codeSource, File cacheFile) throws IOException
IOException
Copyright © 2005–2018. All rights reserved.