Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-11654

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

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 7.1.0.ER3
    • 7.1.0.ER2
    • REST
    • None
    • Workaround Exists
    • Hide

      Call DatasourceProvider.getInputStream() or write DataSource into the response to ensure the file will be deleted.

      Show
      Call DatasourceProvider.getInputStream() or write DataSource into the response to ensure the file will be deleted.
    • Hide
      • git clone https://github.com/resteasy/Resteasy.git
      • git checkout 3.0
      • mvn clean install -DskipTests
      • cd testsuite
      • mvn clean verify -fn -Dtest=DefaultMediaTypeTest,BigSmallDataSourceTest -Dserver.home=PATH_TO_EAP
      • check /tmp directory for resteasy-provider-datasource* files
      Show
      git clone https://github.com/resteasy/Resteasy.git git checkout 3.0 mvn clean install -DskipTests cd testsuite mvn clean verify -fn -Dtest=DefaultMediaTypeTest,BigSmallDataSourceTest -Dserver.home=PATH_TO_EAP check /tmp directory for resteasy-provider-datasource* files

    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: