eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'AbstractFTPSession':

Home

everywhere
www.exept.de
for:
[back]

Class: AbstractFTPSession


Inheritance:

   Object
   |
   +--AbstractFTPSession
      |
      +--FTPSession
      |
      +--SmalltalkFTPSession

Package:
stx:goodies/communication
Category:
Net-Communication-FTP
Version:
rev: 1.8 date: 2007/06/13 08:33:55
user: cg
file: AbstractFTPSession.st directory: goodies/communication
module: stx stc-classLibrary: communication
Author:
Claus Gittinger (extracted code from FTPSession)

Description:


Helper class for the FTPServer.

Common code for FTP serverSessions - add concrete subclass
The stuff implemented here realizes the protocol;
real file operations and authorization must be implemented in subclasses.

Methods which should be redefined are found in the 'must be redefined' category.


Class protocol:

defaults
o  ftpVersion


Instance protocol:

accessing
o  server: something

debugging
o  log: aMessage

o  logCommand: aMessage

ftp system
o  HELP
send all commands supported by FTP server

o  NOOP
no instruction command

o  PASS
password from user; already readin from USER command

o  PORT

o  QUIT
shutdown server

o  REIN
reinitialize server

o  SITE

o  STAT

o  SYST

o  USER

ftp user commands
o  CDUP
change to parent directory

o  CWD
change working directory

o  DELE
delete file or (empty) directory

o  LIST
show directory contents; longFormat

o  MKD
make directory

o  NLST
show directory contents; shortFormat

o  PWD
get current working directory

o  RETR

o  RMD
recursive delete directory

o  STOR

o  STOU

o  TYPE
set mode:
bin (I or i) := #binary
ascii(A or a) := #ascii

must be redefined
o  canChangeWorkingDirectory: newDirectory
raise an error: must be redefined in concrete subclass(es)

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

o  checkPassword: arg1 for: arg2
raise an error: must be redefined in concrete subclass(es)

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

o  defaultDirectoryForUser: userName
raise an error: must be redefined in concrete subclass(es)

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

o  doDELETE: recursive
raise an error: must be redefined in concrete subclass(es)

o  doLIST: arg
raise an error: must be redefined in concrete subclass(es)

o  doMKD: arg
raise an error: must be redefined in concrete subclass(es)

o  doRETR: file onTo: outStream
raise an error: must be redefined in concrete subclass(es)

o  doSTORE: arg
raise an error: must be redefined in concrete subclass(es)

o  loginUserNeedsPassword: arg
raise an error: must be redefined in concrete subclass(es)

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

private
o  closeDataConnection

o  doReinitialize
reinitialize the system; called when:
- user logged out
- system before shutdown
- reinitailze system request
- during startup

o  doUserLoggedIn: aUser
setup user context

o  nextCommand
reads the next command from socket; if a timeout occurs nil is returned otherwise
the command as symbol and the lastArgument is set to the received argument

o  serveSocket: aSocket

private ftp
o  checkAndGetArgFilename

o  checkAndGetCWD

o  checkAndGetDaTaConnection

process
o  clientOn: aSocket
process for new client

queries
o  isBinary


Demonstration:


    FTPServer start.


    FTPServer startOnPort:portNr.



ST/X 6.1.1; WebServer 1.620 at exept:8081; Thu, 17 May 2012 15:40:32 GMT