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

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

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 3.0.24.Final, 3.1.4.Final
    • 3.0.23.Final
    • None
    • None

    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.

      Attachments

        Issue Links

          Activity

            People

              mstefank Martin Stefanko
              kanovotn Katerina Odabasi (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: