diff options
author | Mario Torre <neugens@limasoftware.net> | 2007-02-09 19:51:07 +0000 |
---|---|---|
committer | Mario Torre <neugens@limasoftware.net> | 2007-02-09 19:51:07 +0000 |
commit | f367015ea8656d668a519556118ffb2e722ba539 (patch) | |
tree | a6c89de103b44316de7b12b2a25cb20577025660 /vm | |
parent | 4e687652bad7ffdf53467a937a1f3c2093dcc152 (diff) | |
download | classpath-f367015ea8656d668a519556118ffb2e722ba539.tar.gz |
2007-02-09 Mario Torre <neugens@limasoftware.net>
* vm/reference/java/io/VMFile.java:
(canExecute): new 1.6 native method.
(setReadable): likewise.
(setWritable): likewise.
(setExecutable): likewise.
* java/io/File.java: added import for gnu.classpath.NotImplementedException.
(setReadOnly): new 1.6 method.
(canExecute): likewise.
(setReadable): likewise.
(setWritable): likewise.
(setExecutable): likewise.
(getUsableSpace): added stub for new 1.6 method.
(getFreeSpace): likewise.
(getTotalSpace): likewise.
(checkExec): new private method to support new 1.6 additions.
* native/jni/java-io/java_io_VMFile.c:
set_file_permissions: new helper function.
Java_java_io_VMFile_setReadable: new native method to bakcup 1.6 methods
in VMFile.java.
Java_java_io_VMFile_setWritable: likewise.
Java_java_io_VMFile_setExecutable: likewise.
Java_java_io_VMFile_canExecute: likewise.
* native/jni/native-lib/cpio.h: added new flags: CPFILE_FLAG_EXEC,
CPFILE_FLAG_USR and CPFILE_FLAG_OFF.
cpio_chmod: new function declaration.
cpio_checkAccess: likewise.
* native/jni/native-lib/cpio.c:
cpio_chmod: new function definition.
cpio_checkAccess: likewise.
Diffstat (limited to 'vm')
-rw-r--r-- | vm/reference/java/io/VMFile.java | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/vm/reference/java/io/VMFile.java b/vm/reference/java/io/VMFile.java index 13d256d42..4f708a4a5 100644 --- a/vm/reference/java/io/VMFile.java +++ b/vm/reference/java/io/VMFile.java @@ -116,6 +116,27 @@ final class VMFile */ static native boolean mkdir(String dirpath); + /** + * Set the read permission of the file. + */ + public 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); + + /** + * Set the execute permission of the file. + */ + public 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 @@ -127,7 +148,7 @@ final class VMFile * This native method checks file permissions for writing */ static synchronized native boolean canWrite(String path); - + /** * This methods checks if a directory can be written to. */ @@ -150,6 +171,11 @@ final class VMFile */ static synchronized native boolean canRead(String path); + /** + * This native method checks file permissions for execution + */ + 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 |