Class FileSize


  • public final class FileSize
    extends Object
    FileSize utility class.
    • Method Detail

      • parse

        public static long parse​(String string,
                                 long defaultValue)
        Converts a string to a number of bytes. Strings consist of a floating point value followed by K, M, or G for kilobytes, megabytes, gigabytes, respectively. The abbreviations KB, MB, and GB are also accepted. Matching is case insensitive.
        Parameters:
        string - The string to convert
        defaultValue - The default value if a problem is detected parsing.
        Returns:
        The Bytes value for the string