public class URLMapDefault extends Object implements URLMap
URLMap.Result
Constructor and Description |
---|
URLMapDefault() |
Modifier and Type | Method and Description |
---|---|
void |
addEntry(String urlpath,
String fileprefix)
Add an entry into the map.
|
protected StringBuilder |
canonURL(XURI xurl) |
void |
load(String filepath) |
protected URLMap.Result |
longestmatch(SortedMap<String,String> map,
String prefix) |
URLMap.Result |
mapPath(String path)
Inverse of mapURL; returns a url path and suffix: U,S
such that mapURL(U)+S = path
Return a Pair specifying:
1.
|
URLMap.Result |
mapURL(String urlpath)
Use some maximal prefix of the url path
to locate the associated file path prefix.
|
String |
toString() |
public void addEntry(String urlpath, String fileprefix) throws DapException
URLMap
addEntry
in interface URLMap
DapException
public void load(String filepath) throws IOException
IOException
public URLMap.Result mapURL(String urlpath) throws DapException
URLMap
mapURL
in interface URLMap
urlpath
- a string specifying the url path to be mappedDapException
- if the map fails
Note that this map does not deal with the whole url, only the path part
because as a rule, the host+port is unknown at the time the map is built
and also because there might be multiple hosts using the same map.public URLMap.Result mapPath(String path) throws DapException
URLMap
mapPath
in interface URLMap
path
- a string specifying the file path to be mappedDapException
- if the map fails
This is an optional operation and if not supported,
throw UnsupportedOperationException.protected URLMap.Result longestmatch(SortedMap<String,String> map, String prefix)
protected StringBuilder canonURL(XURI xurl)
Copyright © 1999–2016 UCAR/Unidata. All rights reserved.