Imp
[using it]
Interface Manipulation Package v4.0 (2008-06-25) a-projector ©copyright Author


imp.core
Class Location

java.lang.Object
  extended by imp.core.Value
      extended by imp.core.Structure
          extended by imp.core.Location
All Implemented Interfaces:
Cloneable, Comparable<Value>

public class Location
extends Structure

Implements a uniform resource identifier of a location.

A Uniform Resource Location describes how to access to a resource in the environment. A resource can be a piece of data or a document location or a dynamic query: communications and input/output are based on such URL.
Several protocols (i.e. telnet:, wais:, ..) are deprecated in these specifications.
URL syntax.At the syntax level, an URL corresponds to the regular expression:
$identifier = $scheme : ($authority)? $path ($query)? ($fragment)?
$authority = ($user (! $password)? (+ $phone-number)? @)? $host (: $port)?
$path = $location $name (. $extension)?
$location = ($name/)?*
$query = ? $property(& $property)?*
$property = $attribute = $value
$fragment = #access-function
where the characters @, :, +, !, /, ., #, ?, = and & stand for themselves.
The Uniform Resource Connection (also called ``authority'') defines all information related to the connection to web resource. The password is never sent as it on the web but encrypted or sent on a ``channel'' (e.g. private phone).
The scheme can be omitted if it is a relative URI corresponding to a file://. For files, the path component is absolute if it begins with ('/'); otherwise it is relative to another base URI and its resolution allows to obtain an absolute URI.
The following fields are defined for a uniform resource identifier of a location:
nametype
location:protocolnameURI scheme or protocol
location:userstringuser login or email name
location:passwordstringuser password
location:phone-numbernumberphone number
location:hoststringhost IP address or name
location:portnumberport number, between 1 and 65535
location:foldernameresource local location: folder or directory
location:namenameresource name
location:extensionnameresource MIME type reference
location:typenameresource MIME type
location:encodingstringthe encoding, if available
location:fragmentnameresource data fragment
location:hiddenconditiontrue if the file is hidden
location:readableconditiontrue if it exists and is readable
location:writableconditiontrue if it exists and is writable
location:directoryconditiontrue if it is a directory
location:fileconditiontrue if it is a regular file
location:lengthnumberresource length in number of bytes
location:modification-datedatelast modified date
location:versiondateversion.release for a CVS file
A standard URI reference is defined by the RFC 2396: Uniform Resource Identifiers (URI) normative specification, amended by RFC 2732: Format for Literal IPv6 Addresses in URLs and with some minor deviations according to the java.net.URI class. Here the phone-number, password and fragment end components have been added in order to complete the specifications.


Field Summary
 
Fields inherited from class imp.core.Value
NULL
 
Method Summary
 URL locationValue()
          Gets this logical-structure as the uniform resource identifier of a location.
 Value setValue(String location)
          Sets this value from the given uniform resource identifier and return this.
 
Methods inherited from class imp.core.Structure
clear, indexOf, setType, sort
 
Methods inherited from class imp.core.Value
cloneThis, create, get, getWrapping, isCyclic, isName, load, main, save, toString, wrappedObject
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

locationValue

public URL locationValue()
Gets this logical-structure as the uniform resource identifier of a location.

Throws:
IllegalStateException - If the uniform resource identifier syntax if spurious.

setValue

public Value setValue(String location)
Sets this value from the given uniform resource identifier and return this.

Parameters:
location - The uniform resource identifier.
As URI:
A Java uniform resource identifier.
As URL:
A Java uniform resource identifier.