commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Morten Simonsen (JIRA)" <>
Subject [jira] Created: (IO-194) FreeSpaceKb() with no input arguments
Date Sun, 08 Feb 2009 13:16:59 GMT
FreeSpaceKb() with no input arguments

                 Key: IO-194
             Project: Commons IO
          Issue Type: Improvement
          Components: Utilities
         Environment: All environments
            Reporter: Morten Simonsen
            Priority: Trivial
             Fix For: 1.5

For those of us not yet on JDK 1.6, this function is very useful. I was a bit put off when
I first saw the interface of the method, since it seemed to me that I had to figure out whether
I wanted C:\ or /hda1 or some other string to perform the disk-size-command upon. After a
short while it dawned upon me to use this piece of code:

	/* Returns the disk size of the volume which holds the working directory */
	public static long freeSpaceKb() throws IOException {
		return freeSpaceKb(new File(".").getAbsolutePath());

Tested on Windows Vista and Linux Ubuntu 8.04. 

Anyway, if this code is really platform-independant, I suggest to add the method shown, even
though all users of the IO library should be able to figure out themselves. However, it makes
it even clearer that the code is cross-platform compatible with no effort. 

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message