Commit 65d5bde8 by Michael Koch Committed by Michael Koch

2005-04-20 Michael Koch <konqueror@gmx.de>

	* java/io/FilePermission.java
	(serialVersionUID): Made private.
	(ALL_FILES): New constant.
	(implies): Handle '<<ALL FILES>>' case.

From-SVN: r98447
parent f5c32e10
2005-04-20 Michael Koch <konqueror@gmx.de>
* java/io/FilePermission.java
(serialVersionUID): Made private.
(ALL_FILES): New constant.
(implies): Handle '<<ALL FILES>>' case.
2005-04-20 Sven de Marothy <sven@physto.se> 2005-04-20 Sven de Marothy <sven@physto.se>
* gnu/java/awt/peer/gtk/GdkGraphics.java: * gnu/java/awt/peer/gtk/GdkGraphics.java:
......
/* java.lang.FilePermission /* FilePermission.java --
Copyright (C) 1998, 2000, 2003, 2004 Free Software Foundation, Inc. Copyright (C) 1998, 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath. This file is part of GNU Classpath.
...@@ -7,7 +7,7 @@ GNU Classpath is free software; you can redistribute it and/or modify ...@@ -7,7 +7,7 @@ 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 it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option) the Free Software Foundation; either version 2, or (at your option)
any later version. any later version.
GNU Classpath is distributed in the hope that it will be useful, but GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
...@@ -42,11 +42,13 @@ import java.security.Permission; ...@@ -42,11 +42,13 @@ import java.security.Permission;
public final class FilePermission extends Permission implements Serializable public final class FilePermission extends Permission implements Serializable
{ {
static final long serialVersionUID = 7930732926638008763L; private static final long serialVersionUID = 7930732926638008763L;
private static final String CURRENT_DIRECTORY = private static final String CURRENT_DIRECTORY =
System.getProperty("user.dir"); System.getProperty("user.dir");
private static final String ALL_FILES = "<<ALL FILES>>";
private boolean readPerm = false; private boolean readPerm = false;
private boolean writePerm = false; private boolean writePerm = false;
private boolean executePerm = false; private boolean executePerm = false;
...@@ -200,14 +202,15 @@ public final class FilePermission extends Permission implements Serializable ...@@ -200,14 +202,15 @@ public final class FilePermission extends Permission implements Serializable
*/ */
public boolean implies(Permission p) public boolean implies(Permission p)
{ {
FilePermission fp;
if (! (p instanceof FilePermission)) if (! (p instanceof FilePermission))
return false; return false;
fp = (FilePermission) p;
String f1 = getName(); String f1 = getName();
if (f1.equals(ALL_FILES))
return true;
FilePermission fp = (FilePermission) p;
String f2 = fp.getName(); String f2 = fp.getName();
if (f1.charAt(0) != File.separatorChar) if (f1.charAt(0) != File.separatorChar)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment