eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'HierarchicalURI':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: HierarchicalURI


Inheritance:

   Object
   |
   +--URI
      |
      +--HierarchicalURI
         |
         +--FileURI
         |
         +--FtpURI
         |
         +--HttpURI
         |
         +--SftpURI

Package:
stx:libbasic2
Category:
Net-Resources
Version:
rev: 1.20 date: 2021/01/20 14:31:33
user: cg
file: HierarchicalURI.st directory: libbasic2
module: stx stc-classLibrary: libbasic2

Description:


Hierarchical URI as defined in RFC2396:

<scheme:[//authority][/absolute_path][?query][#fragment]>



[instance variables:]

[class variables:]

copyright

COPYRIGHT (c) 2002 by eXept Software AG All Rights Reserved This software is furnished under a license and may be used only in accordance with the terms of that license and with the inclusion of the above copyright notice. This software may not be provided or otherwise made available to, or used by, any other person. No title to or ownership of the software is hereby transferred.

Class protocol:

instance creation
o  new
(comment from inherited method)
return an instance of myself without indexed variables

o  scheme: aSchemeString fromString: aString
parse the hierarchical information.
schemeString is ignored here


Instance protocol:

accessing
o  authority
return the value of the instance variable 'authority' (automatically generated)

o  authority: something
set the value of the instance variable 'authority' (automatically generated)

o  baseName
(URI fromString:'file:/phys/exept/tmp/foo.html') baseName.
(URI fromString:'file:/phys/exept/tmp/foo') baseName.
(URI fromString:'file:/phys/exept/tmp/') baseName.
(URI fromString:'file:/phys/') baseName.
(URI fromString:'file:/phys') baseName.

(URI fromString:'file://phys/exept/tmp/foo.html') baseName.
(URI fromString:'file://phys/exept/tmp/foo') baseName.
(URI fromString:'file://phys/exept/tmp/') baseName.
(URI fromString:'file://phys/exept/tmp') baseName.
(URI fromString:'file://phys/exept/') baseName.
(URI fromString:'file://phys/exept') baseName.
(URI fromString:'file://phys/') baseName.
(URI fromString:'file://phys') baseName.
(URI fromString:'file://') baseName.

o  directoryPath
answer the directory path part of the URI

o  examples
more examples to be added:
[exBegin]
URI fromString:'file:/phys/exept/home/tm/tmp'
[exEnd]

o  fragment
return the value of the instance variable 'fragment' (automatically generated)

o  fragment: something
set the value of the instance variable 'fragment' (automatically generated)

o  isAbsolute
return the value of the instance variable 'isAbsolute' (automatically generated)

o  isDirectory
return the value of the instance variable 'isDirectory' (automatically generated)

o  path
answer the path part of the URI

o  pathSegments
return the value of the instance variable 'pathSegments' (automatically generated)

o  pathSegments: something
set the value of the instance variable 'pathSegments' (automatically generated)

o  query
return the value of the instance variable 'query' (automatically generated)

o  query: something
set the value of the instance variable 'query' (automatically generated)

accessing-details
o  host
answer the host part of authority

Usage example(s):

      (self fromString:'ftp://stefan@www.exept.de:80/test') host
      (self fromString:'ftp://www.exept.de:80/test') host
      (self fromString:'ftp://www.exept.de/test') host

o  password
answer the user part of authority

Usage example(s):

      (self fromString:'ftp://stefan@www.exept.de:80/test') password
      (self fromString:'ftp://stefan:pass@www.exept.de:80/test') password
      (self fromString:'ftp://www.exept.de:80/test') password

o  port
answer the port part of authority

Usage example(s):

      (self fromString:'ftp://stefan@www.exept.de:80/test') port    
      (self fromString:'ftp://www.exept.de:80/test') port       
      (self fromString:'ftp://www.exept.de/test') port          

o  user
answer the user part of authority

Usage example(s):

      (self fromString:'ftp://stefan@www.exept.de:80/test') user
      (self fromString:'ftp://stefan:pass@www.exept.de:80/test') user
      (self fromString:'ftp://www.exept.de:80/test') user

comparing
o  = anHierarchicalUri

o  hash

copying-private
o  postCopy
(comment from inherited method)
this is for compatibility with ST-80 code, which uses postCopy for
cleanup after copying, while ST/X passes the original in postCopyFrom:
(see there)

defaults
o  defaultPort
answer the default port for the given scheme.
Concrete subclasses redefine this method

escape
o  unEscape
convert escaped characters (such as %20 for ' ') to their native
representation

initialization
o  fromString: aString
self new fromString:'//exept~/tmp'
self new fromString:'~/tmp'
self new fromString:'/~/tmp'
self new fromString:'//authority/path1/path2/'
self new fromString:'//authority/path1/path2?query'
self new fromString:'//authority/path1/path2?query#fragment'
self new fromString:'/path1/path2?query#fragment'
self new fromString:'/path1/path2#fragment'
self new fromString:'path1/path2#fragment'

o  initialize
(comment from inherited method)
just to ignore initialize to objects which do not need it

printing & storing
o  printOn: aStream

o  printOn: aStream escape: doEscape
print the URI on aStream. If doEscape is set, escape special
characters

o  printPathOn: aStream escape: doEscape
print the path part

o  publicPrintOn: aStream
print, but omit password information

resolution
o  / aString
concatenate aString to my path.
Same as #construct:, but simpler to use

o  addComponent: aString
concatenate aString to my path

o  construct: aString
concatenate aString to my path

o  directory
remove the last path component

o  removeLastComponent
remove the last component


Examples:


more examples to be added:
  |u1 u2|

  u1 := URI fromString:'file:/phys/exept/tmp/'.
  u2 := u1 construct:'test.txt'.
  Transcript showCR:u1.
  Transcript showCR:u2.
  |u1 u2|

  u1 := URI fromString:'file:/phys/exept/tmp'.
  u2 := u1 construct:'test.txt'.
  Transcript showCR:u1.
  Transcript showCR:u2.


ST/X 7.7.0.0; WebServer 1.702 at 20f6060372b9.unknown:8081; Wed, 24 Jul 2024 15:01:35 GMT