if (deletePerm && ! fp.deletePerm)
if (fp.deletePerm && ! deletePerm)
  public boolean implies(Permission p)   {    if (! (p instanceof FilePermission))      return false;    String f1 = getName();    if (f1.equals(ALL_FILES))      return true;        FilePermission fp = (FilePermission) p;    String f2 = fp.getName();    if (f1.charAt(0) != File.separatorChar)      f1 = CURRENT_DIRECTORY + f1;    if (f2.charAt(0) != File.separatorChar)      f2 = CURRENT_DIRECTORY + f2;    String sub1;    switch (f1.charAt(f1.length() - 1))      {      case '*':	sub1 = f1.substring(0, f1.length() - 1); // chop off "*"	if (f2.length() <= sub1.length())	  {	    // If it's smaller, there is no way it could be part of	    // this directory.  If it's the same (or length - 1), it	    // could be the same directory but specifies access to	    // the directory rather than the files in it.	    return false;	  } 	else if (f2.charAt(sub1.length() - 1) == File.separatorChar)	  {	    // Make sure the part before the "/" is the same.	    if (! f2.substring(0, sub1.length()).equals(sub1))	      return false;	    // Make sure there are no subdirectories specified	    // underneath this one.	    if (f2.substring(sub1.length() + 1).indexOf(File.separatorChar)		!= -1)	      return false;	  }	else	  {	    // Obviously not equal: f2 is either not a directory or	    // is not the same directory (its name continues further	    // than we want).	    return false;	  }	break;      case '-':	// Chop off "/-".	sub1 = f1.substring(0, f1.length() - 2);	if (f2.length() < sub1.length())	  {	    // If it's smaller, there is no way it could be part of	    // this directory.	    return false;	  }	else if (f2.length() > sub1.length()		 && f2.charAt(sub1.length()) != File.separatorChar)	  return false;	else if (! f2.substring(0, sub1.length()).equals(sub1))	  return false;	break;      default:	if (f2.charAt(f2.length() - 1) == File.separatorChar)	  {	    if (! f1.equals(f2.substring(0, f2.length() - 1)))	      return false;	  }	else if (!f1.equals(f2))	  return false;	break;      }    if (readPerm && ! fp.readPerm)      return false;    if (writePerm && ! fp.writePerm)      return false;    if (executePerm && ! fp.executePerm)      return false;    if (deletePerm && ! fp.deletePerm)      return false;        return true;  }