Uploaded image for project: 'RESTEasy'
  1. RESTEasy
  2. RESTEASY-741

InputStreamProvider not closing stream in writeTo

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 2.3.4.Final
    • Fix Version/s: 2.3.5.Final
    • Component/s: jaxrs
    • Labels:
      None

      Description

      The InputStreamProvider class successfully copies data from the InputStream to the response OutputStream, but it doesn't close the InputStream. Unless I am missing something (always possible!) there is no way for the InputStream to be closed.

      My use case is returning artifact content in an S-RAMP repository Atom API binding. In the Atom API binding, most endpoints return Atom formatted data. There is a /media endpoint for S-RAMP artifacts that will return the original raw binary content, which gets returned from the repository as an InputStream. My jaxrs method looks like this:

      @GET
      @Path("

      {uuid}

      /media")
      @Produces(MediaType.TEXT_XML)
      public InputStream getContent(@PathParam("uuid") String uuid)

      { return srampRepository.getArtifactContent(uuid); }

      My expectation is that resteasy would close my InputStream when it was done streaming the content.

        Attachments

          Activity

            People

            Assignee:
            ron_sigal Ronald Sigal
            Reporter:
            eric.wittmann Eric Wittmann
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: