~jd-team/jdownloader/appwork-utils

« back to all changes in this revision

Viewing changes to src/org/appwork/utils/Files.java

  • Committer: daniel
  • Date: 2021-02-23 16:41:54 UTC
  • Revision ID: svn-v4:21714237-3853-44ef-a1f0-ef8f03a7d1fe::3473

Show diffs side-by-side

added added

removed removed

Lines of Context:
517
517
        return bestRootMatch == null ? null : new File(bestRootMatch);
518
518
    }
519
519
 
 
520
    public static long getFreeDiskSpace(final File file) {
 
521
        final File root = guessRoot(file);
 
522
        // WARNING: File.getFreeSpace also include reserved blocks (eg Linux FileSystems)! Use File.getUsableSpace
 
523
        if (root != null) {
 
524
            return root.getUsableSpace();
 
525
        } else {
 
526
            return file.getUsableSpace();
 
527
        }
 
528
    }
 
529
 
520
530
    /**
521
531
     * @param path
522
532
     * @return