org.mmbase.util
Class ResourceLoader.PathURLStreamHandler

java.lang.Object
  extended by java.net.URLStreamHandler
      extended by org.mmbase.util.ResourceLoader.PathURLStreamHandler
All Implemented Interfaces:
Comparable<ResourceLoader.PathURLStreamHandler>
Direct Known Subclasses:
NodeURLStreamHandlerFactory.NodeURLStreamHandler, ResourceLoader.AbstractFileURLStreamHandler, ResourceLoader.ClassLoaderURLStreamHandler, ResourceLoader.ServletResourceURLStreamHandler
Enclosing class:
ResourceLoader

abstract static class ResourceLoader.PathURLStreamHandler
extends URLStreamHandler
implements Comparable<ResourceLoader.PathURLStreamHandler>

Extension URLStreamHandler, used for the 'sub' Handlers, entries of 'roots' in ResourceLoader are of this type.


Field Summary
protected  ResourceLoader parent
           
protected  int weight
           
 
Constructor Summary
ResourceLoader.PathURLStreamHandler(ResourceLoader p)
           
 
Method Summary
 int compareTo(ResourceLoader.PathURLStreamHandler o)
           
(package private) abstract  ResourceLoader.PathURLStreamHandler createSubHandler(ResourceLoader parent)
           
protected abstract  String getName(URL u)
          When a URL has been created, in openConnection(String), this method can make a 'name' of it again.
(package private) abstract  Set<String> getPaths(Set<String> results, Pattern pattern, boolean recursive, boolean directories)
           
 Integer getResourceNode(String name)
           
(package private)  Enumeration<URL> getResources(String name)
          Returns a List of URL's with the same name.
abstract  URLConnection openConnection(String name)
          We need an openConnection by name only, and public.
protected  URLConnection openConnection(URL u)
           
 void setWeight(int w)
           
 String toString()
           
 
Methods inherited from class java.net.URLStreamHandler
equals, getDefaultPort, getHostAddress, hashCode, hostsEqual, openConnection, parseURL, sameFile, setURL, setURL, toExternalForm
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

parent

protected final ResourceLoader parent

weight

protected int weight
Constructor Detail

ResourceLoader.PathURLStreamHandler

ResourceLoader.PathURLStreamHandler(ResourceLoader p)
Method Detail

createSubHandler

abstract ResourceLoader.PathURLStreamHandler createSubHandler(ResourceLoader parent)

openConnection

public abstract URLConnection openConnection(String name)
We need an openConnection by name only, and public.


getName

protected abstract String getName(URL u)
When a URL has been created, in openConnection(String), this method can make a 'name' of it again.


getResources

Enumeration<URL> getResources(String name)
                        throws IOException
Returns a List of URL's with the same name. Defaults to one URL.

Throws:
IOException

openConnection

protected URLConnection openConnection(URL u)
                                throws IOException
Specified by:
openConnection in class URLStreamHandler
Throws:
IOException

getPaths

abstract Set<String> getPaths(Set<String> results,
                              Pattern pattern,
                              boolean recursive,
                              boolean directories)

setWeight

public void setWeight(int w)

compareTo

public int compareTo(ResourceLoader.PathURLStreamHandler o)
Specified by:
compareTo in interface Comparable<ResourceLoader.PathURLStreamHandler>

getResourceNode

public Integer getResourceNode(String name)
Since:
MBase-2.0

toString

public String toString()
Overrides:
toString in class Object


MMBase 2.0-SNAPSHOT - null