Class NonRDFSource

java.lang.Object
com.inrupt.client.NonRDFSource
All Implemented Interfaces:
Resource, AutoCloseable
Direct Known Subclasses:
SolidNonRDFSource

public class NonRDFSource extends Object implements Resource
A base class for non-RDF-bearing resources.

This class can be used as a basis for object mapping with the high-level client operations.

  • Constructor Details

    • NonRDFSource

      protected NonRDFSource(URI identifier, String contentType, InputStream entity)
      Create a new non-RDF-bearing resource.

      Subclasses should have the same constructor signature to work with the provided object mapping mechanism.

      Parameters:
      identifier - the resource identifier
      contentType - the content type of the resource
      entity - the resource entity
    • NonRDFSource

      protected NonRDFSource(URI identifier, String contentType, InputStream entity, Headers headers)
      Create a new non-RDF-bearing resource.

      Subclasses should have the same constructor signature to work with the provided object mapping mechanism.

      Parameters:
      identifier - the resource identifier
      contentType - the content type of the resource
      entity - the resource entity
      headers - header values associated with the resource, may be null
  • Method Details

    • getIdentifier

      public URI getIdentifier()
      Description copied from interface: Resource
      The resource identifier.
      Specified by:
      getIdentifier in interface Resource
      Returns:
      the identifier
    • getContentType

      public String getContentType()
      Description copied from interface: Resource
      The content type of the resource.
      Specified by:
      getContentType in interface Resource
      Returns:
      the content type
    • getHeaders

      public Headers getHeaders()
      Description copied from interface: Resource
      The resource headers.
      Specified by:
      getHeaders in interface Resource
      Returns:
      the resource headers
    • getEntity

      public InputStream getEntity() throws IOException
      Description copied from interface: Resource
      The resource entity.
      Specified by:
      getEntity in interface Resource
      Returns:
      the resource entity
      Throws:
      IOException - in the case of an error when generating the entity
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable