| java.lang.Object org.mmbase.util.xml.URIResolver
URIResolver | public class URIResolver implements javax.xml.transform.URIResolver,SizeMeasurable,Serializable(Code) | | This URIResolver can be used to resolve URI's, also in TransformerFactory's.
It has knowledge of a kind of path (as used by shells). Every entry
of this path is labeled with a 'prefix'.
This path always has at least (and on default) two entries:
- Current working directory (prefix: none or 'file:')
- MMBase configuration directory (prefix: 'mm:')
Optionially you can add other dirs between these two.
When you start searching in the current working dir, and the URI
does not point to an existing file, it starts searching downwards in
this list, until it finds a file that does exist.
author: Michiel Meeuwissen. since: MMBase-1.6 version: $Id: URIResolver.java,v 1.29 2008/02/12 17:21:22 michiel Exp $ |
Inner Class :public static class EntryList extends ArrayList implements Serializable | |
Constructor Summary | |
public | URIResolver(URL c, boolean overhead) This constructor does not create an actual object that can be
used. | public | URIResolver(URL c) Create an URIResolver for a certain directory. | public | URIResolver(File f) | public | URIResolver() Create an URIResolver without support for a certain directory. | public | URIResolver(File f, EntryList extraDirs) | public | URIResolver(URL c, EntryList extraDirs) Besides the current working directory you can also supply an
ordered list of URIResolver.Entry's. |
URIResolver | public URIResolver(URL c, boolean overhead)(Code) | | This constructor does not create an actual object that can be
used. Only the hashCode is filled. This is because I liked it
possible a URIResolver to be equal to a File. But 'equals' must
be symmetric, and only a File can be equal to a File. It seemed
stupid to extend URIResolver from File, only for this. If you
want to compare a File to to an URIResolver (in Maps), you
could wrap the file in such an empty URIResolver, and avoid all
further overhead.
Parameters: c - The directory for which this URIResolver must (not) be created. Parameters: overhead - A boolean. It is ignored. It serves only to distinct this constructor from the other one. See Also: org.mmbase.cache.xslt.FactoryCache |
URIResolver | public URIResolver(URL c)(Code) | | Create an URIResolver for a certain directory.
Parameters: c - The directory for which this URIResolver must be created. |
URIResolver | public URIResolver()(Code) | | Create an URIResolver without support for a certain directory. (Will be taken the first root).
|
URIResolver | public URIResolver(File f, EntryList extraDirs)(Code) | | |
URIResolver | public URIResolver(URL c, EntryList extraDirs)(Code) | | Besides the current working directory you can also supply an
ordered list of URIResolver.Entry's. First in this list are the
directories which must be checked first, in case no prefix is
given.
Parameters: c - 'Current working dir' Parameters: extraDirs - A EntryList, containing 'extra' dirs withprefixes. If not specified or null, there will still be one'extra dir' available, namely the MMBase configurationdirectory (with prefix mm:) |
equals | public boolean equals(Object o)(Code) | | URIResolver can be used as a key in Maps (Caches).
|
getByteSize | public int getByteSize()(Code) | | |
getCwd | public URL getCwd()(Code) | | Returns the working directory which was supplied in the
constructor.
|
getPath | public String getPath()(Code) | | Creates a 'path' string, which is a list of directories. Mainly usefull for debugging, of course.
A String which could be used as a shell's path. |
getPrefixPath | public List<String> getPrefixPath()(Code) | | Creates a List of strings, every entry is a directory prefixed with its 'prefix'. Handy during debugging.
A List with prefix:path Strings. |
hashCode | public int hashCode()(Code) | | URIResolver can be used as a key in Maps (Caches).
|
|
|