ARC SDK
|
URLMap allows mapping certain patterns of URLs to other URLs. More...
#include <arc/data/URLMap.h>
Public Member Functions | |
URLMap () | |
Construct an empty URLMap. More... | |
bool | map (URL &url) const |
Map a URL if possible. More... | |
bool | local (const URL &url) const |
Check if a mapping exists for a URL. More... | |
void | add (const URL &templ, const URL &repl, const URL &accs=URL()) |
Add an entry to the URLMap. More... | |
operator bool () const | |
Returns true if the URLMap is not empty. More... | |
bool | operator! () const |
Returns true if the URLMap is empty. More... | |
URLMap allows mapping certain patterns of URLs to other URLs.
A URLMap can be used if certain URLs can be more efficiently accessed by other means on a certain site. For example a GridFTP storage element may be mounted as a local file system and so a map can be made from a gsiftp:// URL to a local file path.
Arc::URLMap::URLMap | ( | ) |
Construct an empty URLMap.
Add an entry to the URLMap.
All URLs matching templ will have the templ part replaced by repl.
templ | template to replace, for example gsiftp://se.org/files |
repl | replacement for template, for example /export/grid/files |
accs | replacement path if it differs in the place the file will actually be accessed (e.g. on worker nodes), for example /mount/grid/files |
bool Arc::URLMap::local | ( | const URL & | url | ) | const |
bool Arc::URLMap::map | ( | URL & | url | ) | const |
Map a URL if possible.
If the given URL matches any template it will be changed to the mapped URL. Additionally, if the mapped URL is a local file, a permission check is done by attempting to open the file. If a different access path is specified for this URL the URL will be changed to link://accesspath. To check if a URL will be mapped without changing it local() can be used.
url | URL to check |
|
inline |
Returns true if the URLMap is not empty.
|
inline |
Returns true if the URLMap is empty.