Class BodyRequestBuilder

    • Constructor Detail

      • BodyRequestBuilder

        protected BodyRequestBuilder​(URI uri,
                                     FcrepoClient client)
        Instantiate builder
        Parameters:
        uri - uri request will be issued to
        client - the client
    • Method Detail

      • body

        protected BodyRequestBuilder body​(InputStream stream)
        Add a body to this request from a stream, with application/octet-stream as its content type
        Parameters:
        stream - InputStream of the content to be sent to the server
        Returns:
        this builder
      • body

        protected BodyRequestBuilder body​(InputStream stream,
                                          String contentType)
        Add a body to this request as a stream with the given content type
        Parameters:
        stream - InputStream of the content to be sent to the server
        contentType - the Content-Type of the body
        Returns:
        this builder
      • body

        protected BodyRequestBuilder body​(File file,
                                          String contentType)
                                   throws IOException
        Add the given file as the body for this request with the provided content type
        Parameters:
        file - File containing the content to be sent to the server
        contentType - the Content-Type of the body
        Returns:
        this builder
        Throws:
        IOException - when unable to stream the body file
      • externalContent

        protected BodyRequestBuilder externalContent​(URI contentURI,
                                                     String contentType,
                                                     String handling)
        Add the given URI to the request as the location a Non-RDF Source binary should use for external content. The handling parameter must be supplied, and informs the server of how to process the request.
        Parameters:
        contentURI - URI of the external content.
        contentType - Mimetype to supply for the external content.
        handling - Name of the handling method, used by the server to determine how to process the external content URI. Standard values can be found in ExternalContentHandling.
        Returns:
        this builder
      • digest

        protected BodyRequestBuilder digest​(String digest,
                                            String alg)
        Provide a checksum for the body of this request
        Parameters:
        digest - checksum to provide as the digest for the request body
        alg - abbreviated algorithm identifier for the type of checksum being added (for example, sha1, md5, etc)
        Returns:
        this builder
      • digestSha1

        protected BodyRequestBuilder digestSha1​(String digest)
        Provide a SHA-1 checksum for the body of this request.
        Parameters:
        digest - sha-1 checksum to provide as the digest for the request body
        Returns:
        this builder
      • digestMd5

        protected BodyRequestBuilder digestMd5​(String digest)
        Provide a MD5 checksum for the body of this request
        Parameters:
        digest - MD5 checksum to provide as the digest for the request body
        Returns:
        this builder
      • digestSha256

        protected BodyRequestBuilder digestSha256​(String digest)
        Provide a SHA-256 checksum for the body of this request
        Parameters:
        digest - sha-256 checksum to provide as the digest for the request body
        Returns:
        this builder
      • addInteractionModel

        protected BodyRequestBuilder addInteractionModel​(String interactionModelUri)
        Add an interaction model to the request
        Parameters:
        interactionModelUri - URI of the interaction model
        Returns:
        this builder
      • ifUnmodifiedSince

        public BodyRequestBuilder ifUnmodifiedSince​(String modified)
        Provide a if-unmodified-since header for this request
        Parameters:
        modified - date to provide as the if-unmodified-since header
        Returns:
        this builder
      • ifMatch

        protected BodyRequestBuilder ifMatch​(String etag)
        Provide an etag for the if-match header for this request
        Parameters:
        etag - etag to provide as the if-match header
        Returns:
        this builder
      • linkAcl

        protected BodyRequestBuilder linkAcl​(String aclUri)
        Provide the URI to an ACL for this request
        Parameters:
        aclUri - URI to the ACL
        Returns:
        this builder
      • ifStateToken

        protected BodyRequestBuilder ifStateToken​(String token)
        Provide a value for the if-state-token header for this request.
        Parameters:
        token - state token value
        Returns:
        this builder