private static long parse(final String argument) throws NumberFormatException {
		if (argument.endsWith("gb")) {
			return Long.parseLong(argument.substring(0, argument.length() - "gb".length()).trim()) * GB;
		} else if (argument.endsWith("mb")) {
			return Long.parseLong(argument.substring(0, argument.length() - "mb".length()).trim()) * MB;
		} else if (argument.endsWith("kb")) {
			return Long.parseLong(argument.substring(0, argument.length() - "kb".length()).trim()) * KB;
		} else if (argument.endsWith("bytes")) {
			return Long.parseLong(argument.substring(0, argument.length() - "bytes".length()).trim());
		} else {
			return Long.parseLong(argument.trim());
		}
	}
private static long parse ( final String argument ) throws NumberFormatException { if ( argument . endsWith ( "gb" ) ) { return Long . parseLong ( argument . substring ( 0 , argument . length ( ) - "gb" . length ( ) ) . trim ( ) ) * GB ; } else if ( argument . endsWith ( "mb" ) ) { return Long . parseLong ( argument . substring ( 0 , argument . length ( ) - "mb" . length ( ) ) . trim ( ) ) * MB ; } else if ( argument . endsWith ( "kb" ) ) { return Long . parseLong ( argument . substring ( 0 , argument . length ( ) - "kb" . length ( ) ) . trim ( ) ) * KB ; } else if ( argument . endsWith ( "bytes" ) ) { return Long . parseLong ( argument . substring ( 0 , argument . length ( ) - "bytes" . length ( ) ) . trim ( ) ) ; } else { return Long . parseLong ( argument . trim ( ) ) ; } }
Parses file size from a string. The units GB, MB, KB and bytes are supported.

@param argument
Lower case file size
@return Parsed file size
@throws NumberFormatException
Failed to parse file size