Uploaded image for project: 'Dev - Nexus Repo'
  1. Dev - Nexus Repo
  2. NEXUS-23968

PyPiHostedFacet does not delete TempBlob on getIndex

    XMLWordPrintable

    Details

      Description

      In PyPiHostedFacetImpl on getIndex() createIndexAsset() is called which creates a TempBlob that is never cleaned up.

      I believe the TempBlob created should be wrapped in a try block like the others so this TempBlob is deleted after getIndex

       

      ```

      private Asset createIndexAsset(final String name,
      final StorageTx tx,
      final String indexPath,
      final Bucket bucket) throws IOException

      { .... TempBlob tempBlob = storageFacet.createTempBlob(new ByteArrayInputStream(html.getBytes(UTF_8)), HASH_ALGORITHMS); ... }

      ```

       

      Should be 

      ```

      try (TempBlob tempBlob = storageFacet.createTempBlob(new ByteArrayInputStream(html.getBytes(UTF_8)), HASH_ALGORITHMS);
      ```

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            Stoellberger Paul
            Last Updated By:
            Joseph Stephens
            Team:
            NXRM - Trinity
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Date of First Response:

                tigCommentSecurity.panel-title