Package com.puppycrawl.tools.checkstyle
Class XmlLoader.LoadExternalDtdFeatureProvider
java.lang.Object
com.puppycrawl.tools.checkstyle.XmlLoader.LoadExternalDtdFeatureProvider
- Enclosing class:
- XmlLoader
Used for setting specific for secure java installations features to SAXParserFactory.
Pulled out as a separate class in order to suppress Pitest mutations.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
System property name to enable external DTD load.static final String
Feature that enables including external general entities in XML files.static final String
Feature that enables including external parameter entities in XML files.static final String
Feature that enables loading external DTD when loading XML files. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
Stop instances being created. -
Method Summary
Modifier and TypeMethodDescriptionstatic void
Configures SAXParserFactory with features required to use external DTD file loading, this is not activated by default to no allow usage of schema files that checkstyle do not know it is even security problem to allow files from outside.
-
Field Details
-
ENABLE_EXTERNAL_DTD_LOAD
System property name to enable external DTD load.- See Also:
-
LOAD_EXTERNAL_DTD
Feature that enables loading external DTD when loading XML files.- See Also:
-
EXTERNAL_GENERAL_ENTITIES
Feature that enables including external general entities in XML files.- See Also:
-
EXTERNAL_PARAMETER_ENTITIES
Feature that enables including external parameter entities in XML files.- See Also:
-
-
Constructor Details
-
LoadExternalDtdFeatureProvider
private LoadExternalDtdFeatureProvider()Stop instances being created.
-
-
Method Details
-
setFeaturesBySystemProperty
public static void setFeaturesBySystemProperty(SAXParserFactory factory) throws SAXException, ParserConfigurationException Configures SAXParserFactory with features required to use external DTD file loading, this is not activated by default to no allow usage of schema files that checkstyle do not know it is even security problem to allow files from outside.- Parameters:
factory
- factory to be configured with special features- Throws:
SAXException
- if an error occursParserConfigurationException
- if an error occurs
-