/[classpath]/classpath/java/io/FilePermission.java
ViewVC logotype

Diff of /classpath/java/io/FilePermission.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.16.2.1 by gnu_andrew, Sun Jan 16 02:14:47 2005 UTC revision 1.16.2.2 by gnu_andrew, Mon Apr 18 01:37:37 2005 UTC
# Line 1  Line 1 
1  /* java.lang.FilePermission  /* FilePermission.java --
2     Copyright (C) 1998, 2000, 2003, 2004 Free Software Foundation, Inc.     Copyright (C) 1998, 2000, 2003, 2004, 2005  Free Software Foundation, Inc.
3    
4  This file is part of GNU Classpath.  This file is part of GNU Classpath.
5    
# Line 7  GNU Classpath is free software; you can Line 7  GNU Classpath is free software; you can
7  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
8  the Free Software Foundation; either version 2, or (at your option)  the Free Software Foundation; either version 2, or (at your option)
9  any later version.  any later version.
10    
11  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
12  WITHOUT ANY WARRANTY; without even the implied warranty of  WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# Line 42  import java.security.Permission; Line 42  import java.security.Permission;
42    
43  public final class FilePermission extends Permission implements Serializable  public final class FilePermission extends Permission implements Serializable
44  {  {
45    static final long serialVersionUID = 7930732926638008763L;    private static final long serialVersionUID = 7930732926638008763L;
46    
47    private static final String CURRENT_DIRECTORY =    private static final String CURRENT_DIRECTORY =
48      System.getProperty("user.dir");      System.getProperty("user.dir");
49    
50      private static final String ALL_FILES = "<<ALL FILES>>";
51    
52    private boolean readPerm = false;    private boolean readPerm = false;
53    private boolean writePerm = false;    private boolean writePerm = false;
54    private boolean executePerm = false;    private boolean executePerm = false;
# Line 200  public final class FilePermission extend Line 202  public final class FilePermission extend
202     */     */
203    public boolean implies(Permission p)    public boolean implies(Permission p)
204    {    {
     FilePermission fp;  
   
205      if (! (p instanceof FilePermission))      if (! (p instanceof FilePermission))
206        return false;        return false;
207    
     fp = (FilePermission) p;  
   
208      String f1 = getName();      String f1 = getName();
209    
210        if (f1.equals(ALL_FILES))
211          return true;
212        
213        FilePermission fp = (FilePermission) p;
214      String f2 = fp.getName();      String f2 = fp.getName();
215    
216      if (f1.charAt(0) != File.separatorChar)      if (f1.charAt(0) != File.separatorChar)

Legend:
Removed from v.1.16.2.1  
changed lines
  Added in v.1.16.2.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26