gnu.kawa.functions

Class BaseUri

Implemented Interfaces:
Named

public class BaseUri
extends Procedure0or1

Field Summary

static BaseUri
baseUri

Method Summary

Object
apply0()
Object
apply1(Object node)
static Object
baseUri()
static Object
baseUri(Object node)
static boolean
hasScheme(String name)
Tests if a URL has a scheme.
static String
resolve(String uri, String base)
Resolve a URI against a base URI.
static int
uriSchemeLength(String uri)
Helper routine to get the scheme part of a URI.

Methods inherited from class gnu.mapping.Procedure0or1

apply0, apply1, apply2, apply3, apply4, applyN, numArgs

Methods inherited from class gnu.mapping.Procedure

apply, apply, apply0, apply1, apply2, apply3, apply4, applyN, check0, check1, check2, check3, check4, checkArgCount, checkN, getName, getProperty, getSetter, getSymbol, match0, match1, match2, match3, match4, matchN, maxArgs, minArgs, name, numArgs, removeProperty, set0, set1, setN, setName, setProperty, setProperty, setSetter, setSymbol, toString

Field Details

baseUri

public static final BaseUri baseUri

Method Details

apply0

public Object apply0()
Overrides:
apply0 in interface Procedure0or1

apply1

public Object apply1(Object node)
Overrides:
apply1 in interface Procedure0or1

baseUri

public static Object baseUri()

baseUri

public static Object baseUri(Object node)

hasScheme

public static boolean hasScheme(String name)
Tests if a URL has a scheme. For convenience, we treat a 1-character "scheme" as an MS-DOS-style "drive letter" - i.e. not a scheme.

resolve

public static String resolve(String uri,
                             String base)
Resolve a URI against a base URI. This does not collapse redundant '..' and '.'; perhaps it should.

uriSchemeLength

public static int uriSchemeLength(String uri)
Helper routine to get the scheme part of a URI. The scheme part is "http:" or "file:" or "ftp:" most commonly. This functions searches for the first ':' that doesn't follow a '/'.
Returns:
The length of the scheme component, not counting the colon, (or alternatively the index of the colon,), or -1 if the is no scheme.