Class DTDResolver

java.lang.Object
net.simplace.core.service.DTDResolver
All Implemented Interfaces:
EntityResolver

public class DTDResolver extends Object implements EntityResolver
Entity resolver that loads DTD and entity files from the class path instead of the network. If a file is not found on the class path, an http:// system ID is used directly, provided its host can be resolved.
Author:
Andreas Enders
  • Constructor Details

    • DTDResolver

      public DTDResolver()
  • Method Details

    • resolveEntity

      public InputSource resolveEntity(String aPublicID, String aSystemID)
      Resolves a DTD or entity file. If the system ID (or the public ID, if no system ID is given) ends with .dtd or .ent (ignoring case and a trailing slash), the file name is looked up on the class path. Otherwise, or if it is not found there, an http:// ID is used as URL if its host can be resolved. After a failed host lookup, further lookups are skipped for 30 seconds.
      Specified by:
      resolveEntity in interface EntityResolver
      Returns:
      an input source for the entity, or null to let the parser use its default behaviour
    • finalize

      protected void finalize()
      Overrides:
      finalize in class Object