Package snap.web
Class FileSite
java.lang.Object
snap.web.WebSite
snap.web.FileSite
This class is a WebSite implementation for local file system.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
doDelete
(WebRequest aReq, WebResponse aResp) Handle a DELETE request.protected void
doGetOrHead
(WebRequest aReq, WebResponse aResp, boolean isHead) Handle a get or head request.protected void
doPut
(WebRequest aReq, WebResponse aResp) Handle a PUT request.protected FileHeader
getFileHeaderForJavaFile
(File javaFile) Returns the file header for given path and java file.protected FileHeader[]
getFileHeadersForJavaFile
(File parentFile) Returns the child file headers at given path.protected File
getJavaFileForLocalPath
(String filePath) Returns the Java file for given local file path.protected File
getJavaFileForUrl
(WebURL aURL) Returns the Java file for a WebURL.protected String
getLocalPathForJavaFile
(File javaFile) Returns the local file path for given java file.protected void
saveLastModTimeForFile
(WebFile aFile, long aTime) Saves the modified time for a file to underlying file system.void
Override to set drive letter path on Windows.Methods inherited from class snap.web.WebSite
addFileChangeListener, createFileForPath, deleteFile, deleteSite, doPost, fileDidPropChange, fileDidReset, firePropChange, flush, getExists, getFileForFileHeader, getFileForPath, getFileForPathImpl, getHostName, getLocalFile, getName, getPassword, getPath, getProp, getResponse, getRootDir, getSandboxSite, getSandboxSiteName, getURL, getUrlAddress, getUrlForPath, getUserName, removeFileChangeListener, resetFiles, saveFile, setPassword, setProp, setUserName, toString
-
Constructor Details
-
FileSite
public FileSite()Constructor.
-
-
Method Details
-
setURL
Override to set drive letter path on Windows. -
doGetOrHead
Handle a get or head request.- Specified by:
doGetOrHead
in classWebSite
-
getFileHeaderForJavaFile
Returns the file header for given path and java file. -
getFileHeadersForJavaFile
Returns the child file headers at given path. -
doPut
Handle a PUT request. -
doDelete
Handle a DELETE request. -
saveLastModTimeForFile
Saves the modified time for a file to underlying file system.- Overrides:
saveLastModTimeForFile
in classWebSite
- Throws:
Exception
-
getJavaFileForUrl
Returns the Java file for a WebURL.- Overrides:
getJavaFileForUrl
in classWebSite
-
getJavaFileForLocalPath
Returns the Java file for given local file path. -
getLocalPathForJavaFile
Returns the local file path for given java file.
-