|
|
Class: HTTPFileService
Object
|
+--HTTPService
|
+--HTTPFileService
|
+--HTTPCGIService
|
+--MacroExpandingCSSFileService
- Package:
- stx:goodies/webServer
- Category:
- Net-Communication-HTTP-Services
- Version:
- rev:
1.111
date: 2009/07/10 11:17:37
- user: cg
- file: HTTPFileService.st directory: goodies/webServer
- module: stx stc-classLibrary: webServer
- Author:
- Christian Penk
This service provides regular HTTP-file access.
All requests below the services linkName are translated
to a file-access below the services fileRoot.
An empty URL (relative to the linkName) is translated to the defaultFileName.
The ReplyPresenter is only used to decorate the files when showing the directory contents.
Service parameters:
directoryListingsAllowed
users are allowed to browse the contents of directories.
showWorldReadableOnly
only show the contents of files and directories, if their access rights
allow access to everyone.
maxCacheSize
the number of file documents that will be cached
in memory for fast access.
The default is 20.
maxCacheDocumentSize
the maximum size of a file document for caching.
Files larger are not cached.
The default is 4K (i.e. quite small)
Take care of memory usage when increasing those values.
defaults
-
defaultExpirationTime
-
a documents expiration time in seconds (returned to browser for its cache)
-
fileCacheExpirationDelta
-
a cached files expiration time (seconds)
-
linkName
-
return the default path (with slash)
-
maxCacheDocumentSize
-
files larger are not cached
-
maxCacheSize
-
max nr of files to cache
-
maxDirectoryCacheSize
-
max nr of directory contents to cache
-
maxDirectoryCacheTimedelta
-
max nr of seconds for directory contents to cache
-
maxMemoryUsedForCache
-
max overall memory used for cache
directory list images
-
backImage
-
This resource specification was automatically generated
by the ImageEditor of ST/X.
-
blankImage
-
This resource specification was automatically generated
by the ImageEditor of ST/X.
-
commonImageDataFor: aImageName
-
-
commonImagePath
-
-
commonImages
-
-
folderImage
-
This resource specification was automatically generated
by the ImageEditor of ST/X.
-
imageList
-
-
linkForImage: anImageKey
-
-
linkForMimeType: anMimeType
-
-
mimeTypeImageDataFor: aMimeTypeOrKey
-
-
mimeTypeImagePath
-
-
unknownImage
-
This resource specification was automatically generated
by the ImageEditor of ST/X.
queries-service
-
isThreadSafe
-
-
settingsApplicationClass
-
my application in the settings dialog
accessing
-
allowRemoveFile
-
-
allowRemoveFile: something
-
-
checkReferrer
-
when true, the documents referrer must be a page from me
(i.e. do not allow cross-site links to my documents).
The onlz exception to this are the services' defaulFileName and root.
-
checkReferrer: aBoolean
-
-
directoryListingsAllowed
-
-
directoryListingsAllowed: aBoolean
-
-
expirationTime
-
a documents expiration time in seconds (returned to browser for its cache)
-
expirationTime: seconds
-
a documents expiration time in seconds (returned to browser for its cache).
An expirationTime of 0 disables the browsers caching.
Caveat: should be named maxAge:
-
reportForbiddenDirectoryListing
-
return true, if a request to list a directory should be
reported as forbidden (403) or as not found (404).
If true, users could learn (and try) the directory structure.
The default is true.
Should probably be settable in the SettingsDialog
-
showWorldReadableOnly
-
answer true, if a file or directory must be readable by the whole world in order to be shown
-
showWorldReadableOnly: something
-
caching
-
cacheData: data forFile: aFileName
-
the contents of small files is cached here
-
cachedDataForFile: aFileName fileInfo: fileInfo
-
small files are cached - look in the cache.
Returns the files data or nil
-
flushCache
-
flush the servers file cache
initialization
-
initialize
-
maintenance html presentation
-
specificChangeFromRequest: aRequest
-
extracts parameter from an html-maintenance post-request
-
specificInputFieldsForRequest: aRequest
-
generates the html-fragment for the maintenance form
queries-service
-
isAllowedInMaintenanceMode
-
return true, if this service is also allowed while the server is in maintenance mode
-
isCGIService
-
-
isFileService
-
response generation
-
commonImageLinkStringFor: aRequest image: anImageKey alt: altString
-
-
directoryListingImageLinkStringFor: aRequest image: aMimeType alt: altString
-
-
process: aRequest
-
-
processDirectory: dirFileName for: aRequest
-
generate a HTML table showing the files in the directory.
-
processDirectoryImageFor: aRequest
-
if the request is for a directory bitmap-image, handle it and retrn true.
Otherwise, return false.
-
redirectFor: aRequest
-
a notFoundRedirection dictionary may hold a redirection url for the notFound url
server cache control
-
fileCacheExpirationDelta
-
a cached files contents expiration time (seconds) - thats the servers caching time
-
fileCacheExpirationDelta: seconds
-
a cached files contents expiration time (seconds) - thats the servers caching time
-
maxCacheDocumentSize
-
the max. size of a memory-cached document
-
maxCacheDocumentSize: numBytes
-
the max. size of a memory-cached document
-
maxCacheSize
-
the max. number of cached documents
-
maxCacheSize: maxNumCached
-
the max. number of cached documents
-
maxMemoryUsedForCache
-
the max. amount of memory used for the cache.
Currently dummy - the amount is not (yet) checked for in the cache handling code
-
maxMemoryUsedForCache: numBytes
-
the max. amount of memory used for the cache.
Currently dummy - the amount is not (yet) checked for in the cache handling code
service-parameter
-
defaultFileName
-
-
defaultFileName: something
-
-
fileRoot
-
-
fileRoot: something
-
-
notFoundRedirection
-
a dictionary which redirects not found urls (keys) to a new url (value)
-
notFoundRedirection: something
-
a dictionary which redirects not found urls (keys) to a new url (value)
settings persistency
-
settingSelectors
-
answer the selectors that are used to configure a service - i.e. those which are
saved in the webServer-settings file.
CachedFileInfo
|