Class CleanupSizeUtil

java.lang.Object
org.exoplatform.addons.documents.cleanup.util.CleanupSizeUtil

public class CleanupSizeUtil extends Object
The ONE definition of what an item's action reclaims, in Java.

There are three consumers of this rule and there must be one rule: the JPQL expression the aggregates sum and the item lists order by (CleanupCampaignItemDAO#RECLAIMABLE_BYTES), the in-memory comparator that merges the owner-chunked pages, and the REST DTO every console row displays. They were drifting apart by construction — the review list had re-implemented the CASE in JavaScript — and a list that ranks by one definition of reclaimable while the totals sum another is a quiet wrong number on the one screen whose purpose is triage.

A DELETE frees its content AND the whole version history it destroys; a PURGE_VERSIONS frees the removal set alone, which is what versionsSize already holds for that action.

  • Method Details

    • reclaimableBytes

      public static long reclaimableBytes(String action, long fileSize, long versionsSize)
      Parameters:
      action - the item's action, as its enum name
      fileSize - content bytes of the file
      versionsSize - version bytes THIS action reclaims
      Returns:
      bytes the action frees
    • reclaimableBytes

      public static long reclaimableBytes(CleanupAction action, long fileSize, long versionsSize)
      Parameters:
      action - the item's action
      fileSize - content bytes of the file
      versionsSize - version bytes THIS action reclaims
      Returns:
      bytes the action frees