public static long getSizeAsLong(final String propertyName, final long defaultValue)
    {
        final String propertyValue = getProperty(propertyName);
        if (propertyValue != null)
        {
            final long value = parseSize(propertyName, propertyValue);
            if (value < 0)
            {
                throw new NumberFormatException(propertyName + " must be positive: " + value);
            }

            return value;
        }

        return defaultValue;
    }
public static long getSizeAsLong ( final String propertyName , final long defaultValue ) { final String propertyValue = getProperty ( propertyName ) ; if ( propertyValue != null ) { final long value = parseSize ( propertyName , propertyValue ) ; if ( value < 0 ) { throw new NumberFormatException ( propertyName + " must be positive: " + value ) ; } return value ; } return defaultValue ; }
Get a size value as a long from a system property. Supports a 'g', 'm', and 'k' suffix to indicate
gigabytes, megabytes, or kilobytes respectively.

@param propertyName to lookup.
@param defaultValue to be applied if the system property is not set.
@return the long value.
@throws NumberFormatException if the value is out of range or mal-formatted.