 | | Interface Manipulation Package v4.0 (2008-06-25) |  | ©copyright |  |
imp.core
Class Location
java.lang.Object
imp.core.Value
imp.core.Structure
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.
- Here, hierarchical URI schemes are considered to input /
output. This includes ``virtual'' locations such as mail but also
(i) news, (ii) fax, (iii) SMS messages and (iv) phone vocal messages (generated from a document by a voice generator or
sent/received as an audio file) can be input/output with similar protocols or remote queries via servlet.
- Other schemes (ended with : instead of ://) define opaque URI corresponding to web services.
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:
name | type | |
location:protocol | name | URI scheme or protocol |
location:user | string | user login or email name |
location:password | string | user password |
location:phone-number | number | phone number |
location:host | string | host IP address or name |
location:port | number | port number, between 1 and 65535 |
location:folder | name | resource local location: folder or directory |
location:name | name | resource name |
location:extension | name | resource MIME type reference |
location:type | name | resource MIME type |
location:encoding | string | the encoding, if available |
location:fragment | name | resource data fragment |
location:hidden | condition | true if the file is hidden |
location:readable | condition | true if it exists and is readable |
location:writable | condition | true if it exists and is writable |
location:directory | condition | true if it is a directory |
location:file | condition | true if it is a regular file |
location:length | number | resource length in number of bytes |
location:modification-date | date | last modified date |
location:version | date | version.release for a CVS file |
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.Value |
cloneThis, create, get, getWrapping, isCyclic, isName, load, main, save, toString, wrappedObject |
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.