|
Class: HTTPFileService
Object
|
+--HTTPService
|
+--HTTPFileService
|
+--HTTPCGIService
|
+--MacroExpandingCSSFileService
- Package:
- stx:goodies/webServer
- Category:
- Net-Communication-HTTP-Services
- Version:
- rev:
1.150
date: 2023/08/04 15:56:02
- user: stefan
- file: HTTPFileService.st directory: goodies/webServer
- module: stx stc-classLibrary: webServer
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)
nameFilter
if non-nil, this is a one-argument block, which controls the visibility
and accessibility of files. It gets the full path filename as argument.
Take care of memory usage when increasing those values.
copyrightCOPYRIGHT (c) 2003 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.
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.
Usage example(s):
self backImage inspect
ImageEditor openOnClass:self andSelector:#backImage
Icon flushCachedIcons
|
-
blankImage
-
This resource specification was automatically generated
by the ImageEditor of ST/X.
Usage example(s):
self blankImage inspect
ImageEditor openOnClass:self andSelector:#blankImage
Icon flushCachedIcons
|
-
commonImageDataFor: aImageName
-
-
commonImagePath
-
-
commonImages
-
DirectoryListingImages := nil.
self directoryListingImages
-
folderImage
-
This resource specification was automatically generated
by the ImageEditor of ST/X.
Usage example(s):
self folderImage inspect
ImageEditor openOnClass:self andSelector:#folderImage
Icon flushCachedIcons
|
-
imageList
-
-
linkForImage: anImageKey
-
-
linkForMimeType: aMimeType
-
-
mimeTypeImageDataFor: aMimeTypeOrKey
-
-
mimeTypeImagePath
-
-
unknownImage
-
This resource specification was automatically generated
by the ImageEditor of ST/X.
Usage example(s):
self unknownImage inspect
ImageEditor openOnClass:self andSelector:#unknownImage
Icon flushCachedIcons
|
old html-reply-composition-stx-obsolete
-
favIconFileRelativePath
-
notice:
this requires a file service to run for the '/files' url
on the
../../goodies/webServer/data/sampleServerDir/files/
folder
operations
-
withOverwriteBaseName: aBaseName do: aBlock
-
queries-service
-
isThreadSafe
-
-
settingsApplicationClass
-
my application in the settings dialog
accessing
-
allowRemoveFile
-
-
allowRemoveFile: aBoolean
-
Modified (format): / 10-01-2022 / 12:40:43 / cg
-
allowUpload
-
-
allowUpload: aBoolean
-
-
charsetOverride: something
-
-
checkReferrer
-
when true, the document's referrer must be a page from me
(i.e. do not allow cross-site links to my documents).
The only 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:
-
nameFilter: aBlock
-
sets an optional name filter - this will get the full pathname of the requested file.
It should return false, if access to the file is to be inhibited
-
nameFilterPattern
-
gets the optional name filter pattern - this will match the basename of the requested file.
-
nameFilterPattern: aGLOBPattern
-
sets an optional name filter pattern - this will match the basename of the requested file.
-
poweredByInfoLine
-
a line like 'service powered by smalltalk/x, at the end
-
poweredByInfoLine: aString
-
a line like 'service powered by smalltalk/x, at the end
-
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 file's cached data or nil
-
fillCacheWithData: data forPseudoFile: aFileNameString
-
can be used to fill the cache with nonexisting, pseudo files.
These will not expire and there is no limit.
-
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
-
request handling
-
commonImageLinkStringFor: aRequest image: anImageKey alt: altString
-
-
directoryListingImageLinkStringFor: aRequest image: aMimeType alt: altString
-
-
process: aRequest
-
have to redirect here because default file may contain relative links
which are expanded by the browser from the current url
-
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.
-
processPostRequest: aRequest
-
-
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) - that's the server's caching time
-
fileCacheExpirationDelta: seconds
-
a cached files contents expiration time (seconds) - that's the server's 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.
Usage example(s):
HTTPService new settingSelectors
self new settingSelectors
|
CachedFileInfo
OverwriteBaseNameQuery
|