eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'URI':

Home

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

Class: URI


Inheritance:

   Object
   |
   +--URI
      |
      +--HierarchicalURI

Package:
stx:libbasic2
Category:
Net-Resources
Version:
rev: 1.23 date: 2019/03/18 10:03:24
user: cg
file: URI.st directory: libbasic2
module: stx stc-classLibrary: libbasic2

Class protocol:

accessing
o  attributes

o  classForScheme: aString
find a class for a given scheme name aString

usage example(s):

    self classForScheme:'file'

o  schemes
answer the schemes supported by an URI-class.
Concrete subclasses redefine this to answer an array of scheme names

o  transferBufferSize

escape
o  escape: aString allow: additionalCharacters on: aStream
self escape:'0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
allow:nil on:TextCollector open

self escape:'Ein text mit blanks und @ & #'
allow:nil on:TextCollector open

o  unEscape: aStream
convert escape sequences to the original characters

usage example(s):

     self unEscape:(self escape:'   &%@   ' )

instance creation
o  fromString: aString
create an URI from a given String

usage example(s):

     self fromString:''
     self fromString:'file:~'
     self fromString:'ftp://exept.exept.de/~stefan/bla'
     self fromString:'cg@exept.exept.de:/cvs/bosch'

o  fromString: aString onError: exceptionBlock
create an URI from a given String

usage example(s):

     self fromString:'' onError:nil    


Instance protocol:

accessing
o  contents

o  method
for compatibility with outdated URL class

o  scheme
return primary scheme of the class.
Concrete subclasses may redefine this

o  scheme: aString

comparing
o  = anURI

o  hash

converting
o  asURI
return myself - I am an URI

printing & storing
o  printOn: aStream

o  publicPrintOn: aStream
print, but omit password information.
Subclasses which know about secret information have to redefine this

subclass responsibility
o  readStreamDo: aBlock
evaluate a block with the read stream as first argument
and a dictionary containing attributes as second argument.
The stream is closed after aBlock has been evaluated.

** This method raises an error - it must be redefined in concrete classes **

o  readStreamsDo: aBlock
evaluate the block with a Collection of streams as first argument
and a dictionary containing attributes as optional second argument,
- a collection with a stream on a single file,
- or a collection with streams on a directorie's files, but not recursive

The streams are closed after aBlock has been evaluated.
Attributes may be the mime type (key #MIME)

** This method raises an error - it must be redefined in concrete classes **

testing
o  isFileScheme

o  isRemote
return true, if this is a remote URI



ST/X 7.2.0.0; WebServer 1.670 at bd0aa1f87cdd.unknown:8081; Thu, 18 Apr 2024 06:24:12 GMT