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

PyPiHostedFacet does not delete TempBlob on getIndex

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

            Unassigned Unassigned
            Stoellberger Paul
            Michael Prescott Michael Prescott
            NXRM - Trinity
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              tigCommentSecurity.panel-title