Package org.zaproxy.zap.utils
Class ZapXmlConfiguration
- java.lang.Object
-
- org.apache.commons.configuration.event.EventSource
-
- org.apache.commons.configuration.AbstractConfiguration
-
- org.apache.commons.configuration.HierarchicalConfiguration
-
- org.apache.commons.configuration.AbstractHierarchicalFileConfiguration
-
- org.apache.commons.configuration.XMLConfiguration
-
- org.zaproxy.zap.utils.ZapXmlConfiguration
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,org.apache.commons.configuration.Configuration
,org.apache.commons.configuration.event.ConfigurationErrorListener
,org.apache.commons.configuration.event.ConfigurationListener
,org.apache.commons.configuration.FileConfiguration
,org.apache.commons.configuration.FileSystemBased
,org.apache.commons.configuration.reloading.Reloadable
,org.apache.commons.configuration.resolver.EntityRegistry
,org.xml.sax.EntityResolver
public class ZapXmlConfiguration extends org.apache.commons.configuration.XMLConfiguration
AXMLConfiguration
with character encoding always set to UTF-8 and delimiter parsing always disabled.Note: This class should be used, always, to read/write from/to the configurations' file used by ZAP, this way there shouldn't be any problems with character encodings.
- See Also:
setDelimiterParsingDisabled(boolean)
,XMLConfiguration
, Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.commons.configuration.AbstractHierarchicalFileConfiguration
org.apache.commons.configuration.AbstractHierarchicalFileConfiguration.FileConfigurationDelegate
-
Nested classes/interfaces inherited from class org.apache.commons.configuration.HierarchicalConfiguration
org.apache.commons.configuration.HierarchicalConfiguration.BuilderVisitor, org.apache.commons.configuration.HierarchicalConfiguration.Node, org.apache.commons.configuration.HierarchicalConfiguration.NodeVisitor
-
-
Constructor Summary
Constructors Constructor Description ZapXmlConfiguration()
Creates a new instance ofZapXmlConfiguration
.ZapXmlConfiguration(java.io.File file)
Creates a new instance ofZapXmlConfiguration
.ZapXmlConfiguration(java.io.InputStream in)
Creates a new instance ofZapXmlConfiguration
with the configuration loaded from the given input stream.ZapXmlConfiguration(java.lang.String fileName)
Creates a new instance ofZapXmlConfiguration
.ZapXmlConfiguration(java.net.URL url)
Creates a new instance ofZapXmlConfiguration
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected javax.xml.parsers.DocumentBuilder
createDocumentBuilder()
protected javax.xml.transform.Transformer
createTransformer()
void
load(java.io.InputStream in)
void
load(java.io.Reader in)
void
setDelimiterParsingDisabled(boolean delimiterParsingDisabled)
Calling this method has no effect.void
setEncoding(java.lang.String encoding)
Calling this method has no effect.void
setListDelimiter(char listDelimiter)
Calling this method has no effect.-
Methods inherited from class org.apache.commons.configuration.XMLConfiguration
addNodes, clear, clone, createDelegate, createDocument, createNode, getDocument, getDocumentBuilder, getEntityResolver, getPublicID, getRegisteredEntities, getRootElementName, getSystemID, initProperties, isAttributeSplittingDisabled, isSchemaValidation, isValidating, registerEntityId, resolveEntity, save, setAttributeSplittingDisabled, setDocumentBuilder, setEntityResolver, setPublicID, setRootElementName, setSchemaValidation, setSystemID, setValidating, validate
-
Methods inherited from class org.apache.commons.configuration.AbstractHierarchicalFileConfiguration
addPropertyDirect, clearProperty, clearTree, configurationChanged, configurationError, containsKey, fetchNodeList, getBasePath, getDelegate, getEncoding, getFile, getFileName, getFileSystem, getKeys, getKeys, getProperty, getReloadingStrategy, getReloadLock, getURL, isAutoSave, isEmpty, load, load, load, load, load, refresh, reload, resetFileSystem, save, save, save, save, save, save, setAutoSave, setBasePath, setDelegate, setFile, setFileName, setFileSystem, setProperty, setReloadingStrategy, setURL, subnodeConfigurationChanged
-
Methods inherited from class org.apache.commons.configuration.HierarchicalConfiguration
clearNode, clearNode, clearReferences, configurationAt, configurationAt, configurationsAt, createAddPath, createSubnodeConfiguration, createSubnodeConfiguration, fetchAddNode, findLastPathNode, findPropertyNodes, getDefaultExpressionEngine, getExpressionEngine, getMaxIndex, getRoot, getRootNode, interpolatedConfiguration, nodeDefined, nodeDefined, removeNode, removeNode, setDefaultExpressionEngine, setExpressionEngine, setRoot, setRootNode, subset
-
Methods inherited from class org.apache.commons.configuration.AbstractConfiguration
addErrorLogListener, addProperty, append, clearPropertyDirect, copy, createInterpolator, getBigDecimal, getBigDecimal, getBigInteger, getBigInteger, getBoolean, getBoolean, getBoolean, getByte, getByte, getByte, getDefaultListDelimiter, getDelimiter, getDouble, getDouble, getDouble, getFloat, getFloat, getFloat, getInt, getInt, getInteger, getInterpolator, getList, getList, getListDelimiter, getLogger, getLong, getLong, getLong, getProperties, getProperties, getShort, getShort, getShort, getString, getString, getStringArray, getSubstitutor, interpolate, interpolate, interpolateHelper, isDelimiterParsingDisabled, isScalarValue, isThrowExceptionOnMissing, resolveContainerStore, setDefaultListDelimiter, setDelimiter, setLogger, setThrowExceptionOnMissing
-
Methods inherited from class org.apache.commons.configuration.event.EventSource
addConfigurationListener, addErrorListener, clearConfigurationListeners, clearErrorListeners, createErrorEvent, createEvent, fireError, fireEvent, getConfigurationListeners, getErrorListeners, isDetailEvents, removeConfigurationListener, removeErrorListener, setDetailEvents
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.commons.configuration.Configuration
addProperty, getBigDecimal, getBigDecimal, getBigInteger, getBigInteger, getBoolean, getBoolean, getBoolean, getByte, getByte, getByte, getDouble, getDouble, getDouble, getFloat, getFloat, getFloat, getInt, getInt, getInteger, getList, getList, getLong, getLong, getLong, getProperties, getShort, getShort, getShort, getString, getString, getStringArray, subset
-
-
-
-
Constructor Detail
-
ZapXmlConfiguration
public ZapXmlConfiguration()
Creates a new instance ofZapXmlConfiguration
.
-
ZapXmlConfiguration
public ZapXmlConfiguration(java.io.InputStream in) throws org.apache.commons.configuration.ConfigurationException
Creates a new instance ofZapXmlConfiguration
with the configuration loaded from the given input stream.- Parameters:
in
- the input stream to load the configuration from.- Throws:
org.apache.commons.configuration.ConfigurationException
- if loading the configuration fails.- Since:
- 2.8.0
-
ZapXmlConfiguration
public ZapXmlConfiguration(java.lang.String fileName) throws org.apache.commons.configuration.ConfigurationException
Creates a new instance ofZapXmlConfiguration
. The configuration is loaded from the file with the specifiedfileName
.- Parameters:
fileName
- the name of the file to load- Throws:
org.apache.commons.configuration.ConfigurationException
- if loading the configuration fails
-
ZapXmlConfiguration
public ZapXmlConfiguration(java.net.URL url) throws org.apache.commons.configuration.ConfigurationException
Creates a new instance ofZapXmlConfiguration
. The configuration is loaded from the specifiedurl
.- Parameters:
url
- the URL- Throws:
org.apache.commons.configuration.ConfigurationException
- if loading the configuration fails
-
ZapXmlConfiguration
public ZapXmlConfiguration(java.io.File file) throws org.apache.commons.configuration.ConfigurationException
Creates a new instance ofZapXmlConfiguration
. The configuration is loaded from the specifiedfile
.- Parameters:
file
- the file that has the configuration- Throws:
org.apache.commons.configuration.ConfigurationException
- if loading the configuration fails
-
-
Method Detail
-
createDocumentBuilder
protected javax.xml.parsers.DocumentBuilder createDocumentBuilder() throws javax.xml.parsers.ParserConfigurationException
- Overrides:
createDocumentBuilder
in classorg.apache.commons.configuration.XMLConfiguration
- Throws:
javax.xml.parsers.ParserConfigurationException
-
createTransformer
protected javax.xml.transform.Transformer createTransformer() throws javax.xml.transform.TransformerException
- Overrides:
createTransformer
in classorg.apache.commons.configuration.XMLConfiguration
- Throws:
javax.xml.transform.TransformerException
-
setEncoding
public void setEncoding(java.lang.String encoding)
Calling this method has no effect. The character encoding used is always the same, UTF-8.- Specified by:
setEncoding
in interfaceorg.apache.commons.configuration.FileConfiguration
- Overrides:
setEncoding
in classorg.apache.commons.configuration.AbstractHierarchicalFileConfiguration
-
setListDelimiter
public void setListDelimiter(char listDelimiter)
Calling this method has no effect. The delimiter parsing is always disabled.- Overrides:
setListDelimiter
in classorg.apache.commons.configuration.AbstractConfiguration
- See Also:
setDelimiterParsingDisabled(boolean)
-
setDelimiterParsingDisabled
public void setDelimiterParsingDisabled(boolean delimiterParsingDisabled)
Calling this method has no effect. The delimiter parsing is always disabled.- Overrides:
setDelimiterParsingDisabled
in classorg.apache.commons.configuration.AbstractConfiguration
-
load
public void load(java.io.InputStream in) throws org.apache.commons.configuration.ConfigurationException
- Specified by:
load
in interfaceorg.apache.commons.configuration.FileConfiguration
- Overrides:
load
in classorg.apache.commons.configuration.XMLConfiguration
- Throws:
org.apache.commons.configuration.ConfigurationException
-
load
public void load(java.io.Reader in) throws org.apache.commons.configuration.ConfigurationException
- Specified by:
load
in interfaceorg.apache.commons.configuration.FileConfiguration
- Overrides:
load
in classorg.apache.commons.configuration.XMLConfiguration
- Throws:
org.apache.commons.configuration.ConfigurationException
-
-