Class ApplicationUpdateStorage

java.lang.Object
lu.kbra.modelizer_next.bootstrap.subapp.ApplicationUpdateStorage

public final class ApplicationUpdateStorage extends Object
Handles paths and file operations for downloaded application update artifacts.
  • Field Details

    • MAX_RETAINED_UPDATES_PER_CHANNEL

      public static final int MAX_RETAINED_UPDATES_PER_CHANNEL
      See Also:
  • Constructor Details

    • ApplicationUpdateStorage

      public ApplicationUpdateStorage()
      Creates an application update storage instance.
    • ApplicationUpdateStorage

      public ApplicationUpdateStorage(ApplicationInventory inventory)
      Creates an application update storage instance.
      Parameters:
      inventory - inventory value used by the operation
  • Method Details

    • getUpdatesDirectory

      public Path getUpdatesDirectory()
      Returns the updates directory.
      Returns:
      the updates directory
    • countFiles

      public int countFiles() throws IOException
      Counts regular files in the supplied directory tree.
      Returns:
      the count files result
      Throws:
      IOException - if the operation cannot be completed
    • calculateDiskUsageBytes

      public long calculateDiskUsageBytes() throws IOException
      Calculates the disk usage bytes during bootstrap/update processing.
      Returns:
      the calculate disk usage bytes result
      Throws:
      IOException - if the operation cannot be completed
    • freeUnusedUpdates

      public long freeUnusedUpdates(UpdateChannel activeChannel, InstalledApplication activeApplication) throws IOException
      Deletes downloaded update files that are no longer needed.
      Parameters:
      activeChannel - active channel value used by the operation
      activeApplication - active application value used by the operation
      Returns:
      the free unused updates result
      Throws:
      IOException - if the operation cannot be completed