- Apache Commons IO 教程
- Apache Commons IO - 主頁
- Apache Commons IO - 概覽
- Apache Commons IO - 環境設定
- Apache Commons IO - IOUtils
- Apache Commons IO - FileUtils
- Apache Commons IO - FilenameUtils
- Apache Commons IO - FileSystemUtils
- Apache Commons IO - IOCase
- Apache Commons IO - LineIterator
- Apache Commons IO - NameFileFilter
- Apache Commons IO - WildcardFileFilter
- Apache Commons IO - SuffixFileFilter
- Apache Commons IO - PrefixFileFilter
- Apache Commons IO - OrFileFilter
- Apache Commons IO - AndFileFilter
- Apache Commons IO - FileEntry
- Apache Commons IO - FileAlterationObserver
- Apache Commons IO - FileAlterationMonitor
- Apache Commons IO - NameFileComparator
- Apache Commons IO - SizeFileComparator
- LastModifiedFileComparator
- Apache Commons IO - TeeInputStream
- Apache Commons IO - TeeOutputStream
- Apache Commons IO - 有用資源
- Apache Commons IO - 快速指南
- Apache Commons IO - 有用資源
- Apache Commons IO - 討論
Apache Commons IO - FileSystemUtils
FileSystemUtils 提供在磁碟驅動器上獲取可用空間的方法。
類宣告
以下是有關 org.apache.commons.io.FileSystemUtils 類的宣告:
public class FileSystemUtils extends Object
FileSystemUtils 類的示例
下面給出了 FileSystemUtils 類的一個示例:
IOTester.java
import java.io.IOException;
import org.apache.commons.io.FileSystemUtils;
public class IOTester {
public static void main(String[] args) {
try {
System.out.println("Free Space " + FileSystemUtils.freeSpaceKb("C:/") + " Bytes");
} catch(IOException e) {
System.out.println(e.getMessage());
}
}
}
輸出
會列印以下結果:
Free Space 61355640 kb
廣告