Uploaded image for project: 'Fedora Repository Project'
  1. Fedora Repository Project
  2. FCREPO-1901

FcrepoResponse object should manage the CloseableHttpResponse, instead of the InputStream to the underlying HttpEntity

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: Fedora 4.4.0
    • Fix Version/s: None
    • Component/s: f4-java-client
    • Labels:
      None
    • Environment:
      Fedora 4.4.0, Java 8, MacOS

      Description

      Users of the FcrepoClient are responsible for managing the resources allocated by the FcrepoClient. Specifically, FCREPO-1875 recommends that users of the FcrepoClient create FcrepoResponse objects within a try-with-resources block, so that any resources allocated by the FcrepoClient are released when the user is done with FcrepoResponse (FcrepoResponse implements Closeable).

      Currently, the FcrepoResponse manages (i.e., will close()) the underlying InputStream of the underlying Apache CloseableHttpResponse.

      It would be better if the FcrepoResponse managed the CloseableHttpResponse itself, and invoke close() on that object, instead of the underlying HttpEntity's InputStream. This issue proposes that the FcrepoResponse manage a instance of CloseableHttpResponse instead of InputStream.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                esm Elliot Metsger
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated: