Class RuleEntityResolver

java.lang.Object
org.languagetool.RuleEntityResolver
All Implemented Interfaces:
EntityResolver

public class RuleEntityResolver extends Object implements EntityResolver
Resolves an XML file's external entity URIs as relative paths.
  • Constructor Details

    • RuleEntityResolver

      public RuleEntityResolver()
  • Method Details

    • resolveEntity

      public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException
      Resolves the entity's absolute path by taking the relative path found in the source XML and combining it with the path of the source XML file (which also must be resolved to a full absolute path).
      Specified by:
      resolveEntity in interface EntityResolver
      Parameters:
      publicId - The public identifier of the external entity being referenced, or null if none was supplied.
      systemId - The system identifier of the external entity being referenced.
      Returns:
      InputSource An InputSource constructed from the resolved path of the file the external entity points to
      Throws:
      SAXException
      IOException
    • getPathFromLTResourceFolder

      public String getPathFromLTResourceFolder(String input)
    • getInputStreamLTEntities

      public InputStream getInputStreamLTEntities(String input)