JDK-4969398 : Need method for determining available disk space given path.
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.io
  • Affected Version: 1.4.0
  • Priority: P2
  • Status: Closed
  • Resolution: Duplicate
  • OS: solaris_9
  • CPU: sparc
  • Submitted: 2003-12-16
  • Updated: 2003-12-16
  • Resolved: 2003-12-16
Related Reports
Duplicate :  
Description
Java needs to provide a standard method for determining available disk
space given a path.  As it stands, the only indication Java provides is
the exception generated when space is exhausted.  This is unacceptable as
it does not allow an application to determine when space is low and warn
the user or take other action before the space is exhausted and serious
side effects occur.  Java is a multi-platform programming environment that
should provide this functionality in the JRE through a standard API call.
Requiring the programmer to write platform specific code for every possible
platform is not acceptable for such a basic function common to all platforms.

###@###.### 2003-12-16

Comments
SUGGESTED FIX Ideally a FileSystem class should be created which would provide access to all common operations such as this. See Bug 4125893. At the very least, a method needs to be available that would take a path and return the available space in bytes for that path. ###@###.### 2003-12-16
16-12-2003

WORK AROUND As it stands, a Java programmer that wishes to avoid serious damage to a user's system must use native code or Runtime.exec calls that are platform specific for every possible platform the app might be run on. This is unacceptable. ###@###.### 2003-12-16
16-12-2003