Interface ResourceFactory

    • Method Detail

      • generate

        Resource generate​(java.lang.String requestId,
                          byte[] content)
                   throws ResourceIOException
        Creates a Resource from a given response body.
        Parameters:
        requestId - a unique identifier for this particular response body.
        content - byte array that represents the origin HTTP response body.
        Returns:
        a Resource containing however much of the response body was successfully read.
        Throws:
        ResourceIOException
      • generate

        Resource generate​(java.lang.String requestId,
                          byte[] content,
                          int off,
                          int len)
                   throws ResourceIOException
        Creates a Resource from a given response body.
        Parameters:
        requestId - a unique identifier for this particular response body.
        content - byte array that represents the origin HTTP response body.
        off - the start offset in the array.
        len - the number of bytes to read from the array.
        Returns:
        a Resource containing however much of the response body was successfully read.
        Throws:
        ResourceIOException
      • generate

        default Resource generate​(java.lang.String requestId,
                                  java.lang.String eTag,
                                  byte[] content,
                                  int off,
                                  int len)
                           throws ResourceIOException
        Creates a Resource from a given response body.
        Parameters:
        requestId - a unique identifier for this particular response body.
        eTag - eTag Strong (unique) identifier for the resource entity with the given requestId, or null when not given or is weak (non-unique).
        content - byte array that represents the origin HTTP response body.
        off - the start offset in the array.
        len - the number of bytes to read from the array.
        Returns:
        a Resource containing however much of the response body was successfully read.
        Throws:
        ResourceIOException