"{ Package: 'stx:libbasic2' }"
HierarchicalURI subclass:#FtpURI
instanceVariableNames:''
classVariableNames:''
poolDictionaries:''
category:'Resources'
!
!FtpURI class methodsFor:'accessing'!
schemes
^ #(ftp)
! !
!FtpURI methodsFor:'defaults'!
defaultPassword
^ 'secret@secret'
!
defaultPort
"answer the default command-port here"
^ 21
!
defaultUser
^ 'anonymous'
! !
!FtpURI methodsFor:'stream access'!
readStreamDo:aBlock
"use FTPClient for now"
|ftp stream|
ftp := FTPClient new.
[
ftp connectTo:self host
port:self port
user:(self user ? self defaultUser)
password:(self password ? self defaultPassword).
stream := ftp getStreamFor:self path.
aBlock value:stream value:(Dictionary new at:#MIME put:'text/plain').
] ensure:[
stream notNil ifTrue:[
stream close.
].
ftp notNil ifTrue:[
ftp close.
].
]
"
'ftp://stefan:mschrat.14@hippo/etc/group' asURI readStreamDo:[:stream :attributes |
self halt
].
"
! !
!FtpURI class methodsFor:'documentation'!
version
^ '$Header: /cvs/stx/stx/libbasic2/FtpURI.st,v 1.1 2002-01-17 14:25:12 stefan Exp $'
! !