Class FileSizeCalculator

java.lang.Object
io.goobi.viewer.controller.FileSizeCalculator

public final class FileSizeCalculator extends Object
Utility class for determining and formatting file sizes. Provides methods to read the byte size of a file from the filesystem and to format raw byte counts as human-readable strings with appropriate units (B, KB, MB, etc.).
  • Method Details

    • getFileSize

      public static long getFileSize(Path path) throws IOException
      Throws:
      IOException
    • formatSize

      public static String formatSize(long sizeInBytes)