Merge GNU Classpath 0.99 into libjava.

From-SVN: r185741
This commit is contained in:
Andrew John Hughes
2012-03-23 15:19:26 +00:00
parent 21669dfe20
commit 0563022a20
516 changed files with 64503 additions and 61116 deletions
@@ -0,0 +1,44 @@
/* VMConsole.java -- helper for java.io.Console
Copyright (C) 2012 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
package java.io;
public final class VMConsole
{
static native String readPassword(Console con);
}
@@ -1,5 +1,5 @@
/* VMFile.java -- Class for methods natively accessing files
Copyright (C) 2004, 2006 Free Software Foundation, Inc.
Copyright (C) 2004, 2006, 2010 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -50,6 +50,7 @@ import gnu.java.io.PlatformHelper;
*/
final class VMFile
{
// FIXME: We support only case sensitive filesystems currently.
static final boolean IS_CASE_SENSITIVE = true;
static final boolean IS_DOS_8_3 = false;
@@ -62,105 +63,113 @@ final class VMFile
}
}
/*
private VMFile() {} // Prohibits instantiation.
/**
* This native method does the actual work of getting the last file
* modification time. It also does the existence check to avoid the
* overhead of a call to exists()
* overhead of a call to exists().
*/
static native long lastModified(String path);
/*
/**
* This native method sets the permissions to make the file read only.
*
* @return true if file exists and the operation completed successfully
*/
static native boolean setReadOnly(String path);
/**
* This method is used to create a temporary file
* This method is used to create a temporary file.
*/
static native boolean create(String path) throws IOException;
/*
/**
* This native function actually produces the list of files in this
* directory
* directory.
*
* @return null if dirpath does not exist or is not a directory;
* null or empty array if the directory is unreadable; an array of
* file names in the directory otherwise.
*/
static native synchronized String[] list(String dirpath);
/*
/**
* This native method actually performs the rename.
*/
static native boolean renameTo(String targetpath, String destpath);
/*
/**
* This native method actually determines the length of the file and
* handles the existence check
* handles the existence check.
*/
static native long length(String path);
/*
/**
* This native method does the actual checking of file existence.
*/
static native boolean exists(String path);
/*
* This native method handles the actual deleting of the file
/**
* This native method handles the actual deleting of the file.
*/
static native boolean delete(String path);
/*
/**
* This method does the actual setting of the modification time.
*/
static native boolean setLastModified(String path, long time);
/*
* This native method actually creates the directory
/**
* This native method actually creates the directory.
*/
static native boolean mkdir(String dirpath);
/**
* Gets the total bytes of the filesystem named by path.
*/
public static native long getTotalSpace(String path);
static native long getTotalSpace(String path);
/**
* Gets the total free bytes of the filesystem named by path.
*/
public static native long getFreeSpace(String path);
static native long getFreeSpace(String path);
/**
* Gets the available bytes of the filesystem named by path.
*/
public static native long getUsableSpace(String path);
static native long getUsableSpace(String path);
/**
* Set the read permission of the file.
*/
public static synchronized native boolean setReadable(String path,
boolean readable,
boolean ownerOnly);
static synchronized native boolean setReadable(String path,
boolean readable,
boolean ownerOnly);
/**
* Set the write permission of the file.
*/
public static synchronized native boolean setWritable(String path,
boolean writable,
boolean ownerOnly);
static synchronized native boolean setWritable(String path,
boolean writable,
boolean ownerOnly);
/**
* Set the execute permission of the file.
*/
public static synchronized native boolean setExecutable(String path,
boolean executable,
boolean ownerOnly);
static synchronized native boolean setExecutable(String path,
boolean executable,
boolean ownerOnly);
/*
/**
* This native method does the actual check of whether or not a file
* is a plain file or not. It also handles the existence check to
* eliminate the overhead of a call to exists()
* eliminate the overhead of a call to exists().
*/
static native boolean isFile(String path);
/**
* This native method checks file permissions for writing
* This native method checks file permissions for writing.
*/
static synchronized native boolean canWrite(String path);
@@ -170,19 +179,23 @@ final class VMFile
static native boolean canWriteDirectory(String path);
/**
* This native method checks file permissions for reading
* This native method checks file permissions for reading.
* It also handles the existence check to eliminate the overhead of
* a call to exists().
*/
static synchronized native boolean canRead(String path);
/**
* This native method checks file permissions for execution
* This native method checks file permissions for execution.
* It also handles the existence check to eliminate the overhead of
* a call to exists().
*/
static synchronized native boolean canExecute(String path);
/*
/**
* This method does the actual check of whether or not a file is a
* directory or not. It also handle the existence check to eliminate
* the overhead of a call to exists()
* directory or not. It also handles the existence check to eliminate
* the overhead of a call to exists().
*/
static native boolean isDirectory(String dirpath);
@@ -359,9 +372,9 @@ final class VMFile
* <p>
* Note that this method, unlike the other methods which return path
* names, can throw an IOException. This is because native method
* might be required in order to resolve the canonical path
* might be required in order to resolve the canonical path.
*
* @exception IOException If an error occurs
*/
public static native String toCanonicalForm(String path) throws IOException;
static native String toCanonicalForm(String path) throws IOException;
}
@@ -1,5 +1,5 @@
/* ObjectInputStream.java -- Class used to read serialized objects
Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2005
Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2010
Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -44,6 +44,7 @@ import java.lang.reflect.Constructor;
final class VMObjectInputStream
{
static
{
if (Configuration.INIT_LOAD_LIBRARY)
@@ -52,6 +53,8 @@ final class VMObjectInputStream
}
}
private VMObjectInputStream() {} // Prohibits instantiation.
/**
* Allocates a new Object of type clazz but without running the
* default constructor on it. It then calls the given constructor on
@@ -1,5 +1,5 @@
/* VMObjectStreamClass.java -- VM helper functions for ObjectStreamClass
Copyright (C) 2003, 2005 Free Software Foundation, Inc.
Copyright (C) 2003, 2005, 2010 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -43,6 +43,7 @@ import java.lang.reflect.Field;
final class VMObjectStreamClass
{
static
{
if (Configuration.INIT_LOAD_LIBRARY)
@@ -51,6 +52,8 @@ final class VMObjectStreamClass
}
}
private VMObjectStreamClass() {} // Prohibits instantiation.
/**
* Returns true if CLAZZ has a static class initializer
* (a.k.a. <clinit>).