File tree Expand file tree Collapse file tree
src/java/org/apache/commons/io Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1717package org .apache .commons .io ;
1818
1919import java .io .BufferedReader ;
20+ import java .io .File ;
2021import java .io .IOException ;
2122import java .io .InputStream ;
2223import java .io .InputStreamReader ;
@@ -176,6 +177,21 @@ public static long freeSpaceKb(String path) throws IOException {
176177 return INSTANCE .freeSpaceOS (path , OS , true );
177178 }
178179
180+ /**
181+ * Returns the disk size of the volume which holds the working directory.
182+ * <p>
183+ * Identical to:
184+ * <pre>
185+ * freeSpaceKb(new File(".").getAbsolutePath())
186+ * </pre>
187+ * @return the amount of free drive space on the drive or volume in kilobytes
188+ * @throws IllegalStateException if an error occurred in initialisation
189+ * @throws IOException if an error occurs when finding the free space
190+ */
191+ public static long freeSpaceKb () throws IOException {
192+ return freeSpaceKb (new File ("." ).getAbsolutePath ());
193+ }
194+
179195 //-----------------------------------------------------------------------
180196 /**
181197 * Returns the free space on a drive or volume in a cross-platform manner.
You can’t perform that action at this time.
0 commit comments