commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r919691 - /commons/proper/io/trunk/src/java/org/apache/commons/io/FileSystemUtils.java
Date Sat, 06 Mar 2010 02:07:46 GMT
Author: sebb
Date: Sat Mar  6 02:07:46 2010
New Revision: 919691

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

Modified: commons/proper/io/trunk/src/java/org/apache/commons/io/FileSystemUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/java/org/apache/commons/io/FileSystemUtils.java?rev=919691&r1=919690&r2=919691&view=diff
==============================================================================
--- commons/proper/io/trunk/src/java/org/apache/commons/io/FileSystemUtils.java (original)
+++ commons/proper/io/trunk/src/java/org/apache/commons/io/FileSystemUtils.java Sat Mar  6
02:07:46 2010
@@ -17,6 +17,7 @@
 package org.apache.commons.io;
 
 import java.io.BufferedReader;
+import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStreamReader;
@@ -176,6 +177,21 @@
         return INSTANCE.freeSpaceOS(path, OS, true);
     }
 
+    /**
+     * Returns the disk size of the volume which holds the working directory.
+     * <p>
+     * Identical to:
+     * <pre>
+     * freeSpaceKb(new File(".").getAbsolutePath())
+     * </pre>
+     * @return the amount of free drive space on the drive or volume in kilobytes
+     * @throws IllegalStateException if an error occurred in initialisation
+     * @throws IOException if an error occurs when finding the free space
+     */
+    public static long freeSpaceKb() throws IOException {
+        return freeSpaceKb(new File(".").getAbsolutePath()); 
+    }
+    
     //-----------------------------------------------------------------------
     /**
      * Returns the free space on a drive or volume in a cross-platform manner.



Mime
View raw message