I want to get the size of a drive (or UNC path pointing to a partition would be nice, but not required), as well as free space for said drive (or UNC path). This doesn't need to work cross platform; only in Windows.
I know it's easy to do in Java 6, but that's not an option; I'm stuck with Java 5.
I can get the free space available by doing:
cmd.exe /c Z:\ /-c
or
cmd.exe /c \\server\share /-c
and just parsing out the resulting bytes free. However I can't seem to find a way to get the total drive size.
Any suggestions?