Import GNU Classpath (classpath-0_97_2-release).
libjava/ 2008-06-28 Matthias Klose <doko@ubuntu.com> Import GNU Classpath (classpath-0_97_2-release). * Regenerate class and header files. * Regenerate auto* files. * gcj/javaprims.h: Define jobjectRefType. * jni.cc (_Jv_JNI_GetObjectRefType): New (stub only). (_Jv_JNIFunctions): Initialize GetObjectRefType. * gnu/classpath/jdwp/VMVirtualMachine.java, java/security/VMSecureRandom.java: Merge from classpath. * HACKING: Fix typo. * ChangeLog-2007: New file. * configure.ac: Set JAVAC, pass --disable-regen-headers to classpath. libjava/classpath/ 2008-06-28 Matthias Klose <doko@ubuntu.com> * m4/ac_prog_javac.m4: Disable check for JAVAC, when not configured with --enable-java-maintainer-mode. * aclocal.m4, configure: Regenerate. * native/jni/gstreamer-peer/Makefile.am: Do not link with libclasspathnative. * native/jni/gstreamer-peer/Makefile.in: Regenerate. * tools/Makefile.am, lib/Makefile.am: Use JAVAC for setting JCOMPILER, drop flags not understood by gcj. From-SVN: r137223
This commit is contained in:
parent
15c151967d
commit
e0441a5bfb
1429 changed files with 32837 additions and 18119 deletions
|
@ -1292,6 +1292,73 @@ public class File implements Serializable, Comparable<File>
|
|||
return VMFile.setExecutable(path, executable, ownerOnly);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the total space for the partition pointed by this file path, in bytes.
|
||||
*
|
||||
* @return the total number of bytes in this partition.
|
||||
* @since 1.6
|
||||
*/
|
||||
public long getTotalSpace()
|
||||
{
|
||||
// check security manager.
|
||||
SecurityManager s = System.getSecurityManager();
|
||||
if (s != null)
|
||||
s.checkPermission(new RuntimePermission("getFileSystemAttributes"));
|
||||
checkRead();
|
||||
|
||||
return VMFile.getTotalSpace(path);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the free space in the partition pointed by this file path, in bytes.
|
||||
*
|
||||
* @return the number of free bytes in this partition.
|
||||
* @since 1.6
|
||||
*/
|
||||
public long getFreeSpace()
|
||||
{
|
||||
// check security manager.
|
||||
SecurityManager s = System.getSecurityManager();
|
||||
if (s != null)
|
||||
s.checkPermission(new RuntimePermission("getFileSystemAttributes"));
|
||||
checkRead();
|
||||
|
||||
return VMFile.getFreeSpace(path);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the usable space in the partition pointed by this file path, in bytes.
|
||||
* This is not necessarily the same as the number returned by
|
||||
* {@link #getFreeSpace()}.
|
||||
*
|
||||
* <strong>Implementation note</strong>: Unlike the RI, on Linux and UNIX
|
||||
* like systems this methods take into account the reserved space for the
|
||||
* "root" user. This means that the returned results will be a little
|
||||
* different if a normal user or root perform the query.
|
||||
*
|
||||
* Also, the bytes returned should be interpreted as an hint, and may be
|
||||
* different at each call of this method or even right after the method
|
||||
* returns.
|
||||
*
|
||||
* @return the number of usable bytes in this partition.
|
||||
* @since 1.6
|
||||
*/
|
||||
public long getUsableSpace()
|
||||
{
|
||||
// check security manager.
|
||||
SecurityManager s = System.getSecurityManager();
|
||||
if (s != null)
|
||||
s.checkPermission(new RuntimePermission("getFileSystemAttributes"));
|
||||
checkRead();
|
||||
|
||||
// root users can use the reserved extra space
|
||||
String user = System.getProperty("user.name");
|
||||
if (user != null && user.equals("root"))
|
||||
return VMFile.getFreeSpace(path);
|
||||
|
||||
return VMFile.getUsableSpace(path);
|
||||
}
|
||||
|
||||
/**
|
||||
* This method sets the file represented by this object to be read only.
|
||||
* A read only file or directory cannot be modified. Please note that
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue