Class HardenedResultDocumentResolver

  • All Implemented Interfaces:
    net.sf.saxon.lib.ResultDocumentResolver

    public class HardenedResultDocumentResolver
    extends net.sf.saxon.lib.StandardResultDocumentResolver
    Based on StandardResultDocumentResolver, this resolver restricts the access to the local file system by using a FilesystemFilter.

    The allowed locations are set from a system property or an environment variable, which define a list of paths. The name of the system property is FileSystemFilter.PROPERTY. The name of the environment variable is FilesystemFilter.ENVIRON. Paths are separated by FilesystemFilter.SEPARATOR.

    Configuration errors result in an empty set of allowed paths, but will be notified on stderr.

    ~ can be used to point to the user's home directory.

    See Also:
    FilesystemFilter
    • Constructor Detail

      • HardenedResultDocumentResolver

        public HardenedResultDocumentResolver()
    • Method Detail

      • createResult

        public StreamResult createResult​(URI absoluteURI)
                                  throws net.sf.saxon.trans.XPathException,
                                         IOException
        Overrides:
        createResult in class net.sf.saxon.lib.StandardResultDocumentResolver
        Throws:
        net.sf.saxon.trans.XPathException
        IOException
      • makeOutputFile

        public static StreamResult makeOutputFile​(URI absoluteURI)
                                           throws net.sf.saxon.trans.XPathException
        Throws:
        net.sf.saxon.trans.XPathException
      • resolve

        public StreamResult resolve​(String href,
                                    String base)
                             throws net.sf.saxon.trans.XPathException
        Overrides:
        resolve in class net.sf.saxon.lib.StandardResultDocumentResolver
        Throws:
        net.sf.saxon.trans.XPathException
      • resolve

        public net.sf.saxon.event.Receiver resolve​(net.sf.saxon.expr.XPathContext context,
                                                   String href,
                                                   String base,
                                                   net.sf.saxon.serialize.SerializationProperties properties)
                                            throws net.sf.saxon.trans.XPathException
        Specified by:
        resolve in interface net.sf.saxon.lib.ResultDocumentResolver
        Overrides:
        resolve in class net.sf.saxon.lib.StandardResultDocumentResolver
        Throws:
        net.sf.saxon.trans.XPathException