SecurityManager s = System.getSecurityManager(); String p = safeCanonicalPath ();   if (p == null) return false; if (s != null) s.checkWrite(p); return access (p, WRITE);
checkWrite(); return access (WRITE);
  public boolean canWrite ()  {    SecurityManager s = System.getSecurityManager();    String p = safeCanonicalPath ();    // FIXME: it isn't entirely clear what to do if we can't find the    // canonical path.    if (p == null)      return false;    if (s != null)      s.checkWrite(p);    return access (p, WRITE);  }