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

DataSourceProvider doesn't clean tmp file if inputstream is not read

    Details

      Description

      DataSourceProvider creates temporary file in the case when Datasource is used as parameter for the resource (example from BigSmallDataSourceTest):

      @POST
      @Consumes("image/jpeg")
      @Produces("text/plain")
      public String postDataSource(DataSource datasource) {
         return datasource.getContentType();
      }    
      

      With http request for the above endpoint DataSourceProvider.readFrom() gets executed which creates tmp file. The input stream of this file is only added for to the Cleanables when DataSourceProvider.getInputStream() is called.

      If DataSource from above endpoint is received by the server and no attempt to read (not calling DatasourceProvider.getInputStream() it or send it back (calling DatasourceProvider.writeTo()) is made, the tmp file is not deleted by the server.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  mstefank Martin Stefanko
                  Reporter:
                  kanovotn Katerina Odabasi
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  1 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: