Class FailedResource

  • All Implemented Interfaces:
    Resource

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

      Constructors 
      Constructor Description
      FailedResource​(java.lang.String uri, XPathException error)
      Create a FailedResource
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getContentType()
      Get the media type (MIME type) of the resource if known
      XPathException getError()
      Get the underlying error
      Item getItem()
      Get an XDM Item holding the contents of this resource.
      java.lang.String getResourceURI()
      Get a URI that identifies this resource
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FailedResource

        public FailedResource​(java.lang.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 java.lang.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 java.lang.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