Author: skitching Date: Tue Feb 8 04:51:03 2005 New Revision: 152670 URL: http://svn.apache.org/viewcvs?view=rev&rev=152670 Log: * add setAllowUnknownExternalEntities and equivalent getter * move getErrorHandler method within file
Modified: jakarta/commons/proper/digester/branches/digester2/src/java/org/apache/commons/digester2/Digester.java Modified: jakarta/commons/proper/digester/branches/digester2/src/java/org/apache/commons/digester2/Digester.java URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/digester/branches/digester2/src/java/org/apache/commons/digester2/Digester.java?view=diff&r1=152669&r2=152670 ============================================================================== --- jakarta/commons/proper/digester/branches/digester2/src/java/org/apache/commons/digester2/Digester.java (original) +++ jakarta/commons/proper/digester/branches/digester2/src/java/org/apache/commons/digester2/Digester.java Tue Feb 8 04:51:03 2005 @@ -450,6 +450,30 @@ } /** + * Specify whether an input xml document is permitted to reference external + * entities (including external DTDs, schemas, and include-files) that have + * not been specified by methods registerKnownEntity or setKnownEntities. + * <p> + * If this is allowed, then documents can take unbounded amounts of time + * to process, as they can attempt to download entities from the network + * (particularly via http urls). + * <p> + * This flag defaults to false (ie unknown external entities are not allowed). + * In this case, any occurrence of such an entity within an xml document + * will cause an exception to be thrown. + */ + public void setAllowUnknownExternalEntities(boolean state) { + saxHandler.setAllowUnknownExternalEntities(state); + } + + /** + * See setAllowUnknownExternalEntities. + */ + public boolean getAllowUnknownExternalEntities() { + return saxHandler.getAllowUnknownExternalEntities(); + } + + /** * Specify whether an external DTD should be ignored, ie treated as if * it were an empty file. This can be dangerous; DTDs can potentially * contain definitions for default attribute values and entities that @@ -740,19 +764,19 @@ } /** - * Return the error handler which will be used if the xml parser detects - * errors in the xml input being parsed. - */ - public ErrorHandler getErrorHandler() { - return saxHandler.getErrorHandler(); - } - - /** * Set the error handler for this Digester. * * @param errorHandler The new error handler */ public void setErrorHandler(ErrorHandler errorHandler) { saxHandler.setErrorHandler(errorHandler); + } + + /** + * Return the error handler which will be used if the xml parser detects + * errors in the xml input being parsed. + */ + public ErrorHandler getErrorHandler() { + return saxHandler.getErrorHandler(); } } --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]