Skip to content

Clarify difference between getFreeSpace and getUsableSpace #59

@hakanai

Description

@hakanai

There are three methods for dealing with overall filesystem space:

/**
 * Return The total size in bytes of this file system.
 *
 * @return total size in bytes or -1 if this feature is unsupported.
 * @throws IOException if an I/O error occurs
 */
public long getTotalSpace() throws IOException;

/**
 * The total free space in bytes of this file system.
 *
 * @return total free space in bytes or -1 if this feature is unsupported
 * @throws IOException if an I/O error occurs
 */
public long getFreeSpace() throws IOException;

/**
 * The usable space of this file system.
 *
 * @return usable space in bytes or -1 if this feature is unsupported
 * @throws IOException if an I/O error occurs
 */
public long getUsableSpace() throws IOException;

It's pretty obvious what "total space" is, but the difference between the other two is less clear from the docs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions