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) |
toStringprotected String address
protected short schemeEnd
protected short authorityEnd
protected short lastSlash
protected short fragmentStart
public URILocator()
public URILocator(String address) throws MalformedURLException
MalformedURLExceptionpublic URILocator(URL url) throws MalformedURLException
MalformedURLExceptionpublic URILocator(File file)
protected URILocator(String normalized, short schemeEnd, short authorityEnd, short lastSlash, short fragmentStart)
protected String normalize(String address) throws MalformedURLException
MalformedURLExceptionpublic String getNotation()
LocatorIFNote that only the URI notation is supported in release OKS 4.0 and newer.
getNotation in interface LocatorIFpublic String getAddress()
LocatorIFgetAddress in interface LocatorIFpublic LocatorIF resolveAbsolute(String rel)
LocatorIFresolveAbsolute in interface LocatorIFpublic String getExternalForm()
LocatorIFgetExternalForm in interface LocatorIFpublic int parseDirectoryPart(char[] uri,
int ix,
int length)
throws MalformedURLException
MalformedURLExceptionpublic int hashCode()
AbstractLocatorhashCode in class AbstractLocatorpublic boolean equals(Object object)
AbstractLocatorequals in class AbstractLocatorpublic void writeExternal(ObjectOutput out) throws IOException
writeExternal in interface ExternalizableIOExceptionpublic void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal in interface ExternalizableIOExceptionClassNotFoundExceptionpublic static URILocator create(String uriAddress)