public class URILocator extends AbstractLocator implements Externalizable
The address is always normalized by the constructor. The address given to the constructor must be absolute.
Modifier and Type | Field and Description |
---|---|
protected String |
address |
protected short |
authorityEnd |
protected short |
fragmentStart |
protected short |
lastSlash |
protected short |
schemeEnd |
Modifier | Constructor and Description |
---|---|
|
URILocator()
INTERNAL: No-argument constructor used by serialization.
|
|
URILocator(File file)
PUBLIC: Creates a URILocator containing a file URL referring
to the file represented by the File object.
|
|
URILocator(String address)
PUBLIC: Creates a URILocator representing the URI given.
|
protected |
URILocator(String normalized,
short schemeEnd,
short authorityEnd,
short lastSlash,
short fragmentStart)
INTERNAL: Special constructor used when resolving a URI relative
to a base URI.
|
|
URILocator(URL url)
PUBLIC: Creates a URILocator representing the URL given.
|
Modifier and Type | Method and Description |
---|---|
static URILocator |
create(String uriAddress)
INTERNAL: Parses the URI and returns an instance of URILocator if
the URI is valid.
|
boolean |
equals(Object object)
PUBLIC: Two LocatorIFs are considered equal if they have the same
address and notation properties.
|
String |
getAddress()
PUBLIC: Returns the locator address in absolute and normalized
form.
|
String |
getExternalForm()
PUBLIC: Returns the address of the locator in external form; that
is, with special characters that need to be escaped escaped using
the escape syntax of the locator notation.
|
String |
getNotation()
PUBLIC: Gets the locator notation.
|
int |
hashCode()
PUBLIC: Returns the hashcode of the address property.
|
protected String |
normalize(String address) |
int |
parseDirectoryPart(char[] uri,
int ix,
int length) |
void |
readExternal(ObjectInput in) |
LocatorIF |
resolveAbsolute(String rel)
PUBLIC: Given a locator address string that is relative to this
locator, return an absolute locator.
|
protected static String |
toExternalForm(String address) |
void |
writeExternal(ObjectOutput out) |
toString
protected String address
protected short schemeEnd
protected short authorityEnd
protected short lastSlash
protected short fragmentStart
public URILocator()
public URILocator(String address) throws MalformedURLException
MalformedURLException
public URILocator(URL url) throws MalformedURLException
MalformedURLException
public URILocator(File file)
protected URILocator(String normalized, short schemeEnd, short authorityEnd, short lastSlash, short fragmentStart)
protected String normalize(String address) throws MalformedURLException
MalformedURLException
public String getNotation()
LocatorIF
Note that only the URI notation is supported in release OKS 4.0 and newer.
getNotation
in interface LocatorIF
public String getAddress()
LocatorIF
getAddress
in interface LocatorIF
public LocatorIF resolveAbsolute(String rel)
LocatorIF
resolveAbsolute
in interface LocatorIF
public String getExternalForm()
LocatorIF
getExternalForm
in interface LocatorIF
public int parseDirectoryPart(char[] uri, int ix, int length) throws MalformedURLException
MalformedURLException
public int hashCode()
AbstractLocator
hashCode
in class AbstractLocator
public boolean equals(Object object)
AbstractLocator
equals
in class AbstractLocator
public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
IOException
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
IOException
ClassNotFoundException
public static URILocator create(String uriAddress)