source: branches/0.22.x/abcl/doc/design/pathnames/url-pathnames.markdown

Last change on this file was 12613, checked in by Mark Evenson, 15 years ago

Document URL and jar pathname design changes.

File size: 3.4 KB
Line 
1URL Pathnames ABCL
2==================
3
4    Mark Evenson
5    Created:  25 MAR 2010
6    Modified: 11 APR 2010
7
8Notes towards an implementation of URL references to be contained in
9Common Lisp `PATHNAME` objects within ABCL.
10
11
12References
13----------
14
15RFC3986   Uniform Resource Identifier (URI): Generic Syntax
16
17
18URL vs URI
19----------
20
21We use the term URL to describe the URL Pathnames, even though RFC3986
22notes that its use should be obsolete because in the context of Common
23Lisp Pathnames all need a lookup mechanism to be resolved or they
24wouldn't be of much use.
25
26Goals
27-----
28
291.  Use Common Lisp pathnames to refer to representations referenced
30by a URL.
31
322.  The URL schemes supported shall include at least "http", and those
33enabled by the URLStreamHandler extension mechanism.
34
353.  Use URL schemes that are understood by the java.net.URL object.
36
37    A file specified by URL
38   
39        #p"http://example.org/org/armedbear/systems/pgp.asd"
40   
414.  MERGE-PATHNAMES
42
43        (merge-pathnames "url.asd"
44            "http://example/org/armedbear/systems/pgp.asd")
45        ==> "http://example/org/armedbear/systems/url.asd"
46
475.  PROBE-FILE returning the state of URL accesibility.
48
496.  TRUENAME "aliased" to PROBE-FILE signalling an error if the URL is
50not accessible (see "Non-goal 1").
51
527.  DIRECTORY for non-wildcards
53
548.  URL pathname work as a valid argument for OPEN with :DIRECTION :INPUT.
55
569.  Enable the loading of ASDF2 systems referenced by a URL pathname.
57
5810.  The reserved URL characters (`~`, `/`, `?`, etc.) shall be
59encoded in the proper manner on construction of the Pathname.
60
6111.  The "file" scheme will continue to be represented by an
62"ordinary" Pathname.
63
6412.  The "jar" scheme will continue to be represented by a jar
65Pathname.
66
67
68Non-goals
69---------
70
711.  We will not implement canonicalization of URL schemas (such as following
72"http" redirects).
73
742.  DIRECTORY working for URL pathnames containing wildcards.
75
76
77Implementation
78--------------
79
80A PATHNAME refering to a resource referenced by a URL is known as a
81URL PATHNAME.
82
83A URL PATHNAME always has a HOST component which is a proper list.
84This list will be an property list (plist).  The property list
85values must be character strings.
86
87    :SCHEME
88        Scheme of URI ("http", "ftp", "bundle", etc.)
89    :AUTHORITY   
90        Valid authority according to the URI scheme.  For "http" this
91        could be "example.org:8080".
92    :QUERY
93        The query of the URI
94    :FRAGMENT
95        The fragment portion of the URI
96       
97The DIRECTORY, NAME and TYPE fields of the PATHNAME are used to form
98the URI `path` according to the conventions of the UNIX filesystem
99(i.e. '/' is the directory separator).  In a sense the HOST contains
100the base URL, to which the `path` is a relative URL (although this
101abstraction is violated somwhat by the storing of the QUERY and
102FRAGMENT portions of the URI in the HOST component).
103
104For the purposes of PATHNAME-MATCH-P, two URL pathnames may be said to
105match if their HOST compoments are EQUAL, and all other components are
106considered to match according to the existing rules for Pathnames.
107
108A URL pathname must have a DEVICE whose value is NIL.
109
110Upon creation, the presence of ".." and "." components in the
111DIRECTORY are removed.  The DIRECTORY component, if present, is always
112absolute.
113
114The namestring of a URL pathname shall be formed by the usual
115conventions of a URL.
116
117A URL Pathname has type URL-PATHNAME, derived from PATHNAME.
118
119Status
120------
121
122This design is a proposal.
Note: See TracBrowser for help on using the repository browser.