Example usage for org.apache.commons.io FileSystemUtils freeSpace

List of usage examples for org.apache.commons.io FileSystemUtils freeSpace

Introduction

In this page you can find the example usage for org.apache.commons.io FileSystemUtils freeSpace.

Prototype

public static long freeSpace(String path) throws IOException 

Source Link

Document

Returns the free space on a drive or volume by invoking the command line.

Usage

From source file:egovframework.rte.fdl.filehandling.FilehandlingServiceTest.java

/**
 * @throws Exception/*from ww  w.  j  ava2  s . co  m*/
 */
@SuppressWarnings("deprecation")
@Test
public void testFileSystemUtils() throws Exception {

    try {
        long freeSpace = FileSystemUtils.freeSpace("C:/");

        assertTrue(freeSpace > 0);

    } catch (Exception e) {
        log.error(e.getCause());
    }
}