You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Sebb (JIRA)" <ji...@apache.org> on 2010/03/06 03:11:27 UTC

[jira] Resolved: (IO-194) FreeSpaceKb() with no input arguments

     [ https://issues.apache.org/jira/browse/IO-194?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sebb resolved IO-194.
---------------------

    Resolution: Fixed

URL: http://svn.apache.org/viewvc?rev=919691&view=rev
Log:
IO-194 FreeSpaceKb() with no input arguments

Modified:
   commons/proper/io/trunk/src/java/org/apache/commons/io/FileSystemUtils.java

> FreeSpaceKb() with no input arguments
> -------------------------------------
>
>                 Key: IO-194
>                 URL: https://issues.apache.org/jira/browse/IO-194
>             Project: Commons IO
>          Issue Type: Improvement
>          Components: Utilities
>         Environment: All environments
>            Reporter: Morten Simonsen
>            Priority: Trivial
>             Fix For: 2.0
>
>   Original Estimate: 0.02h
>  Remaining Estimate: 0.02h
>
> 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.