Class FailedResource

  • All Implemented Interfaces:
    Resource

    public class FailedResource
    extends Object
    implements Resource
    FailedResource represents an item in a collection that could not be processed because of some kind of error
    • Constructor Detail

      • FailedResource

        public FailedResource​(String uri,
                              XPathException error)
        Create a FailedResource
        Parameters:
        uri - the URI of the resource
        error - the error that occurred when attempting to process the resource
    • Method Detail

      • getContentType

        public String getContentType()
        Get the media type (MIME type) of the resource if known
        Specified by:
        getContentType in interface Resource
        Returns:
        always null for this kind of resource
      • getResourceURI

        public String getResourceURI()
        Get a URI that identifies this resource
        Specified by:
        getResourceURI in interface Resource
        Returns:
        a URI identifying this resource
      • getItem

        public Item getItem()
                     throws XPathException
        Get an XDM Item holding the contents of this resource. This method always throws the error associated with the resource.
        Specified by:
        getItem in interface Resource
        Returns:
        an item holding the contents of the resource. This version of the method never returns an item; it always throws an error
        Throws:
        XPathException - if a failure occurs materializing the resource
      • getError

        public XPathException getError()
        Get the underlying error