Network-RemoteDirectory

HTTPServerDirectory
A HTTPServerDirectory is xxxxxxxxx.
Instance Variables
dirListUrl
directoryNamed:
Return a copy of me pointing at this directory below me
directoryNames
Return a collection of names for the subdirectories of this directory but filter out project directories.
entries
Return a collection of directory entries for the files and directories in this directory. Each entry is a five-element array: (<name> <creationTime> <modificationTime> <dirFlag> <fileSize>).
fileNames
Return a collection of names for the files (but not directories) in this directory.
oldFileNamed:
If the file exists, answer a read-only RemoteFileStream on it. aName is directory path, and does include name of the server. Or it can just be a fileName. For now, pre-read the file.
pathName
Path name as used in reading the file. with slashes for ftp, with local file delimiter (:) for a file: url
readOnlyFileNamed:
If the file exists, answer a read-only RemoteFileStream on it. aName is directory path, and does include name of the server. Or it can just be a fileName. For now, pre-read the file.
typeForPrefs
ProjectSwikiServer
A ProjectSwikiServer is xxxxxxxxx.
Instance Variables
acceptsUploads: <Object>
acceptsUploads
- xxxxx
acceptsUploads
acceptsUploads:
Do nothing yet
isProjectSwiki
wakeUp
Start a multi-action session: Open for FTP and keep the connection open
RemoteFileStream
An in-memory stream that can be used to fileIn code from the network. Knows its ServerFile, and thus its name, path, etc.
localDataValid -- false when have never read the file from the server. Set to true after reading, when my contents has the true data. When creating a remote file, set localDataValid to true so it will write to server.
close
Write if we have data to write. FTP files are always binary to preserve the data exactly. The binary/text (ascii) flag is just for tell how the bits are delivered from a read.
contentsOfEntireFile
Fetch the data off the server and store it in me. But not if I already have it.
dataIsValid
directory
directoryUrl
localName
openReadOnly
If we have data, don't reread.
padToEndWith:
On the Mac, files do not truncate, so pad it with a harmless character. But Remote FTP files always replace, so no need to pad.
readOnly
remoteFile
remoteFile:
sleep
If we are done, then let the server know
ServerDirectory
Holds all the information needed to read or write on a directory of an internet server. I am used for FTP and HTTP (and STMP? NNTP?). The password policy is: unless it is a public password (like annomyous), clear all passwords before any snapshot. There is a way to store passwords on the disk.
server 'www.disney.com' or '123.34.56.08' or the ServerDirectory above me
(if I am a subdirectory sharing the info in a master directory)
directory 'ftp/pubs/' name of my directory within the server or superdirectory.
(for file://, directory is converted to local delimiters.)
type #ftp what you can do in this directory
user 'Jones45'
password an instance of Password.
group an Association ('group name' -> an array of ServerDirectorys)
If this first one is down, try the next one. Store on all of them. I am in the list.
moniker 'Main Squeak Directory' Description of this directory.
altURL When a FTP server holds some web pages, the altURL of those pages is often
different from the FTP directory. Put the altURL here. If the directory is
'public_html/Squeak/', the altURL might be 'www.webPage.com/~kaehler2/
Squeak/'.
urlObject An instance of a subclass of Url. It is very good at parsing complex urls.
Relative references. file:// uses this. Use this in the future instead of
server and directory inst vars.
socket nil or an FTPSocket. Only non-nil if the connection is being kept open
for multiple stores or retrievals.
loaderUrl a partial url that is ised to invoke squeak in a browser and load a project.
A normal call on some command like (aServer getFileNamed: 'foo') does not set 'socket'. Socket being nil tells it to close the connection and destroy the socket after this one transcation. If the caller stores into 'socket', then the same command does NOT close the
connection.
Call 'openKeepFTP' or 'openGroup' to store into socket and keep the connection open. It is up to the user to call 'quit' or 'closeGroup' later.
DD openKeepFTP.
Transcript cr; show: ((DD getFileNamed: '1198misc-tkKG.cs') next: 100).
Transcript cr; show: ((DD getFileNamed: '1192multFinder-tkKF.cs') next: 100).
DD quit.
acceptsUploads
acceptsUploads:
Do nothing yet
addServer:named:
altUrl
When a ftp server also has http access, use this to store the http url
altUrl:
asServerFileNamed:
assureExistence
Make sure the current directory exists. If necessary, create all parts inbetween
assureExistenceOfPath:
Make sure the local directory exists. If necessary, create all parts inbetween
bareDirectory
checkNames:
Look at these names for update and see if they are OK
checkServersWithPrefix:andParseListInto:
Check that all servers are up and have the latest Updates.list.
Warn user when can't write to a server that can still be read.
The contents of updates.list is parsed into {{vers. {fileNames*}}*},
and returned via the listBlock.
closeGroup
Close connection with all servers in the group.
containingDirectory
convertGroupName
convertGroupNames
copy
Answer another instance just like the receiver. Subclasses typically override postCopy; they typically do not override shallowCopy.
copyUpdatesNumbered:toVersion:
Into the section of updates.list corresponding to otherVersion,
copy all the fileNames from this version matching the selectList.
createDirectory:
Create a new sub directory within the current one
defaultStemUrl
deleteDirectory:
Delete the sub directory within the current one. Call needs to ask user to confirm.
deleteFileNamed:
Detete a remote file. fullName is directory path, and does include name of the server. Or it can just be a fileName.
determineLocalServerDirectory:
dirPathFor:
Return the directory part the given name.
directory
String of part of url that is the directory. Has slashes as separators
directory:
directoryNamed:
Return a copy of me pointing at this directory below me
directoryNames
Return a collection of names for the subdirectories of this directory.
directoryObject
directoryWrapperClass
downloadUrl
The url under which files will be accessible.
encodingName
encodingName:
entries
Return a collection of directory entries for the files and directories in this directory. Each entry is a five-element array: (<name> <creationTime> <modificationTime> <dirFlag> <fileSize>).
exists
It is difficult to tell if a directory exists. This is ugly, but it works for writable directories. http: will fall back on ftp for this
exportUpdatesExcept:
Into the section of updates.list corresponding to this version,
copy all the fileNames in the named updates.list for this group
that are more recently numbered.
fetchExternalSettingsIn:
fileAndDirectoryNames
FileDirectory default fileAndDirectoryNames
fileExists:
Does the file exist on this server directory? fileName must be simple with no / or references to other directories.
fileNamed:
Create a RemoteFileStream for writing. If the file exists, do not complain. fullName is directory path, and does include name of the server. Or it can just be a fileName. Only write the data upon close.
fileNames
Return a collection of names for the files (but not directories) in this directory.
fromUser
Ask the user for all data on a new server. Save it in a named server.
fullNameFor:
Convention:
If it is an absolute path, directory stored with a leading slash, and url has no user@.
If relative path, directory stored with no leading slash, and url begins user@.
Should we include ftp:// on the front?
fullPath:
Parse and save a full path. Convention: if ftp://user@server/dir, then dir is relative to user's directory. dir has no slash at beginning. If ftp://server/dir, then dir is absolute to top of machine, give dir a slash at the beginning.
getDirectory
Return a stream with a listing of the current server directory. (Later -- Use a proxy server if one has been registered.)
getFileList
Return a stream with a list of files in the current server directory. (Later -- Use a proxy server if one has been registered.)
getFileNamed:
Just FTP a file from a server. Return contents.
(Later -- Use a proxy server if one has been registered.)
getFileNamed:into:
getFileNamed:into:httpRequest:
Just FTP a file from a server. Return a stream. (Later -- Use a proxy server if one has been registered.)
getOnly:from:
Use FTP to just capture the first nnn characters of the file. Break the connection after that. Goes faster for long files. Return the contents, not a stream.
getOnlyBuffer:from:
Open ftp, fill the buffer, and close the connection. Only first part of a very long file.
groupName
groupName:
groupNames
includesKey:
Answer true if this directory includes a file or directory of the given name. Note that the name should be a local file name, in contrast with fileExists:, which takes either local or full-qualified file names.
initialize
Subclasses should redefine this method to perform initializations on instance creation
isProjectSwiki
isRemoteDirectory
answer whatever the receiver is a remote directory
isRoot
isSearchable
isTypeFTP
isTypeFile
isTypeHTTP
keepAlive
keepAlive:
loaderUrl
loaderUrl:
localName
localNameFor:
Return the local part the given name.
localPathExists:
matchingEntries:
Ignore the filter criteria for now
moniker
a plain language name for this directory
moniker:
a plain language name for this directory
moveAllButYoungest:in:to:
Specialized to files with names of the form 'aName_vvv.ext'. Where vvv is a mime-encoded base 64 version number. Versions is an array of file names tokenized into three parts (aName vvv ext). Move the files by renaming them on the server.
nameForServer:
newFileNamed:
Create a RemoteFileStream. If the file exists, and complain. fullName is directory path, and does include name of the server. Or it can just be a fileName. Only write the data upon close.
newFrom:
oldFileNamed:
If the file exists, answer a read-only RemoteFileStream on it. aName is directory path, and does include name of the server. Or it can just be a fileName. For now, pre-read the file.
oldFileOrNoneNamed:
If the file exists, answer a read-only RemoteFileStream on it. If it doesn't, answer nil. fullName is directory path, and does include name of the server. Or just a simple fileName. Do prefetch the data.
on:
Answer another ServerDirectory on the partial path name. fullName is directory path, and does include the name of the server.
openFTPClient
openGroup
Open all servers in the group. Don't forget to close later.
outOfDate:
Inform the user that this server does not have a current version of 'Updates.list' Return true if the user does not want any updates to happen.
parseFTPEntry:
parseServerEntryFrom:
password
password:
passwordSequence
passwordSequence:
pathName
Path name as used in reading the file. with slashes for ftp, with local file delimiter (:) for a file: url
pathNameDelimiter
the separator that is used in URLs
pathParts
Return the path from the root of the file system to this directory as an array of directory names. On a remote server.
printOn:
Append to the argument, aStream, a sequence of characters that
identifies the receiver.
projectServers
putFile:named:
Just FTP a local fileStream to the server. (Later -- Use a proxy server if one has been registered.)
putFile:named:retry:
ar 11/24/1998 Do the usual putFile:named: operation but retry if some error occurs and aBool is set. Added due to having severe transmission problems on shell.webpage.com.
putFileSavingOldVersion:named:
Put a copy of this file out after saving the prior version.
Nothing happens to the old version until the new vers is successfully stored.
putUpdate:
Put this file out as an Update on the servers of my group. Each version of the system may have its own set of update files, or they may all share the same files. 'updates.list' holds the master list. Each update is a fileIn whose name begins with a number. See Utilities class readServerUpdatesThrough:saveLocally:updateImage:.
When two sets of updates are stored on the same directory, one of them has a * in its
serverUrls description. When that is true, the first word of the description is put on
the front of 'updates.list', and that index file is used.
putUpdateMulti:fromDirectory:
Put these files out as an Update on the servers of my group. List is an array of local file names with or without number prefixes. Each version of the system has its own set of update files. 'updates.list' holds the master list. Each update is a fileIn whose name begins with a number. See Utilities class absorbUpdatesFromServer.
quit
break the connection
quitClient
break the connection
readOnlyFileNamed:
If the file exists, answer a read-only RemoteFileStream on it. aName is directory path, and does include name of the server. Or it can just be a fileName. For now, pre-read the file.
realUrl
a fully expanded version of the url we represent. Prefix the path with http: or ftp: or file:
releaseExternalSettings
removeServerNamed:
removeServerNamed:ifAbsent:
rename:toBe:
Rename a remote file. fullName is just be a fileName, or can be directory path that includes name of the server. newName is just a fileName
reset
resetServers
secondsForDay:month:yearOrTime:thisMonth:thisYear:
server
server:
serverConfDirectoryName
serverDelimiter
the separator that is used in the place where the file actually is. ftp server or local disk.
serverForURL:
serverInGroupNamed:
serverNamed:
serverNamed:ifAbsent:
serverNames
servers
serversInGroup
serversInGroupNamed:
slashDirectory
sleep
If still connected, break the connection
splitName:to:
Take the file name and convert it to the path name of a directory and a local file name within that directory. FileName must be of the form: <dirPath><delimiter><localName>, where <dirPath><delimiter> is optional. The <dirPath> part may contain delimiters.
storeCurrentServersIn:
storeServerEntryOn:
streamOnBeginningOf:
type:
typeForPrefs
typeWithDefault
upLoadProject:members:retry:
upLoadProject:named:resourceUrl:retry:
Upload the given project file. If it's an archive, upload only the files that are local to the project.
updateInstallVersion:
For each server group, ask whether we want to put the new version marker (eg 'Squeak2.3') at the end of the file. Current version of Squeak must be the old one when this is done.
ServerDirectory new updateInstallVersion: 'Squeak9.9test'
updateProjectInfoFor:
only swiki servers for now
url
This was mis-named at the beginning. Eventually convert over to altUrl and use this for the real url.
url:
urlObject
urlObject:
user
user:
wakeUp
Start a multi-action session: Open for FTP and keep the connection open
writeProject:inFileNamed:fromDirectory:
write aProject (a file version can be found in the file named fileNameString in localDirectory)
ServerFile
Represents the non-data part of a file on a server on the internet. I am owned by a RemoteFileStream, who has the data.
Since FileStream is a Stream and I am not, use this to always get a stream:
xxx isStream ifFalse: [^ xxx asStream].
asStream
Return a RemoteFileStream (subclass of RWBinaryOrTextStream) on the contents of the remote file I represent. For reading only. This method is probably misnamed. Maybe call it makeStream
directoryUrl
A url to the directory this file is in
exists
Return true if the file exists on the server already
fileName
should this be local or as in a url?
fileName:
fileNameRelativeTo:
Produce an absolute fileName from me and an absolute directory
fullPath:
Parse and save a full path. Separate out fileName at the end.
localName
readOnly
Set the receiver to be read-only
readWrite
Set the receiver to be writable
realUrl
a fully expanded version of the url we represent. Prefix the path with http: or ftp: or file:
writable
SwikiPseudoFileStream
A SwikiPseudoFileStream is xxxxxxxxx.
Instance Variables
directory: <Object>
directoryUrl: <Object>
localName: <Object>
directory
- xxxxx
directoryUrl
- xxxxx
localName
- xxxxx
directory
directory:
directoryObject
directoryUrl
directoryUrl:
fileName
isTypeHTTP
localName
localName: