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

InputStreamProvider not closing stream in writeTo

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 2.3.5.Final
    • 2.3.4.Final
    • jaxrs
    • None
    • All

      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.

              rsigal@redhat.com Ronald Sigal
              ewittman@redhat.com Eric Wittmann
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: