private static final int parseSizeUnits(String unit)
{
    if(unit==null) return 1;
    if(unit.length()==0) return 1;
    char c;
    c=unit.toLowerCase().charAt(0);
    switch(c)
    {
       case 'b':
	      return 1;
       case 'k':
	      return 1024; // kilobytes
       case 'm':
	      return 1024*1024; // megabytes
       case 'g':
	      return 1024*1024*1024; // gigabytes
    }
    System.out.println("Unknown size unit: '"+unit+"'");
    return 0;
}