public class XMLResource extends HttpResource
HttpResource.HttpDataParams
extension, fileName, isFromRoot, name, webServer
Constructor and Description |
---|
XMLResource(HttpWebServer webServer,
String fileName,
String name,
String extension)
Creates a new XML resource without loading it.
|
Modifier and Type | Method and Description |
---|---|
byte[] |
getData(HttpSession httpSession,
HttpResource.HttpDataParams params)
Get the data that is transformed through parsing and modification of
the resource if the resource is an XML document.
|
Document |
getDocument()
Gets the original XML document.
|
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 XMLResource(HttpWebServer webServer, String fileName, String name, String extension)
load
method.public void setParse(boolean doParse)
public Document getDocument()
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 params)
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.