HttpURI.st
author Claus Gittinger <cg@exept.de>
Fri, 29 Aug 2003 21:33:49 +0200
changeset 1310 948ed141b0b7
parent 1309 c752d54f4e09
child 1461 998d6076f34d
permissions -rw-r--r--
*** empty log message ***

"
 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.
"

"{ Package: 'stx:libbasic2' }"

HierarchicalURI subclass:#HttpURI
	instanceVariableNames:''
	classVariableNames:''
	poolDictionaries:''
	category:'Net-Resources'
!

!HttpURI class methodsFor:'documentation'!

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.
"
! !

!HttpURI class methodsFor:'accessing'!

schemes

    ^ #(http)
! !

!HttpURI methodsFor:'defaults'!

defaultPort

    ^ 80
! !

!HttpURI methodsFor:'stream access'!

readStreamDo:aBlock
    "use HTTPInterface for now"

    |response headerInfo mime|

    response := HTTPInterface get:self path 
                    fromHost:self host 
                    port:self port
                    accept:#('*/*')  
                    fromDocument:nil.

    headerInfo := response headerInfo.
    mime := headerInfo at:'content-type' ifAbsent:nil.
    mime notNil ifTrue:[
        headerInfo at:#MIME put:mime.
    ].
    aBlock value:response data readStream value:headerInfo

    "
     'http://www.exept.de/' asURI readStreamDo:[:stream :attributes | 
         self halt
      ].
    "
! !

!HttpURI methodsFor:'testing'!

isRemote
    "return true, if this is a remote URI"

    ^ true
! !

!HttpURI class methodsFor:'documentation'!

version
    ^ '$Header: /cvs/stx/stx/libbasic2/HttpURI.st,v 1.4 2003-08-29 19:33:43 cg Exp $'
! !