Here you can find the source of getFreeSpace(String dir)
Parameter | Description |
---|---|
dir | the directory stored in the partition |
public static long getFreeSpace(String dir)
//package com.java2s; /*//from www .java 2s.c o m * Copyright (c) 2008-2011 by Bjoern Kolbeck, Jan Stender, * Felix Langner, Zuse Institute Berlin * * Licensed under the BSD License, see LICENSE file for details. * */ import java.io.File; public class Main { /** * Returns the free disk space on the partition storing the given directory. * * @param dir * the directory stored in the partition * @return the free disk space */ public static long getFreeSpace(String dir) { return new File(dir).getFreeSpace(); } }