code: public boolean canWrite()
      {
          if ( ! _strutsConfigFile.canWrite() )
          {
              return false;
          }
          
          try
          {
              //
              // This appears to be the only way to predict whether the file can actually be
              // written to; it may be that canWrite() returns true, but the file permissions
              // (NTFS only?) will cause an exception to be thrown.
              //
              new FileOutputStream( _strutsConfigFile, true ).close();
          }
          catch ( FileNotFoundException e )
          {
              return false;
          }
          catch ( IOException e )
          {
              return false;
          }
          
          return true;
      }
docs: In some cases, canWrite() does not guarantee that a FileNotFoundException will not
  be thrown when trying to write to a file.  This method actually tries to overwrite
  the file as a test to see whether it's possible.