public class HtmlResource extends HttpResource
HttpResource.HttpDataParams
extension, fileName, isFromRoot, name, webServer
Constructor and Description |
---|
HtmlResource(HttpWebServer webServer,
String fileName,
String name,
String extension)
Creates a new HTML resource without loading it.
|
Modifier and Type | Method and Description |
---|---|
byte[] |
getData(HttpSession httpSession,
HttpResource.HttpDataParams dParams)
Get the data that is transformed through parsing and modification of
the resource if the resource is an HTML document.
|
HtmlParser |
getParser()
Gets the HTML parser.
|
boolean |
hasDynamicData(HttpSession httpSession)
Checks if this resource could return different content for each call to getData
when the last modified time has not been changed.
|
protected void |
loadInternal(HttpResourceParameters httpParams)
Loads or reloads the file.
|
boolean |
reload()
Reloads a the resource if required.
|
void |
setParse(boolean doParse)
Sets no parsing for this document.
|
getFileSize, getHitCount, getLastModified, getParamObj, increaseHitCount, isHandleSet, isUncached, load, sendRawDataInBlocks
public HtmlResource(HttpWebServer webServer, String fileName, String name, String extension)
load
method.public void setParse(boolean doParse)
public HtmlParser getParser()
protected void loadInternal(HttpResourceParameters httpParams) throws IOException
IOException
- if the loading of the resource fails even when it exists.FileNotFoundException
- if the loading of the resource cannot be found.public boolean reload()
If the document is not loaded, nothing will happen.
No failures will occur, because (e.g.) if the file is not found anymore the first content will be used.
This is typically done for application or error documents.
reload
in class HttpResource
public byte[] getData(HttpSession httpSession, HttpResource.HttpDataParams dParams)
getData
in class HttpResource
public boolean hasDynamicData(HttpSession httpSession)
hasDynamicData
in class HttpResource
httpSession
- The session instance.Phantom® and NetPhantom® are registered trademarks of Mindus SARL.
© © Mindus SARL, 2024. All rights reserved.