*/
public double getDoubleValue()
{
if (!isValid())
throw new RuntimeException("Cannot find Harddisk drive " + _drive);
File file = new File(_drive);
switch (_infoType)
{
case FreeSpaceInPercent:
return ((double) file.getFreeSpace() / (double) file.getTotalSpace()) * 100;
case FreeSpaceInBytes:
return file.getFreeSpace();
case TotalSpaceinBytes:
return file.getTotalSpace();
case UsedSpaceInBytes:
return file.getTotalSpace() - file.getFreeSpace();
default:
return -1;
}
}