rem: showError(getStringBundle().GetStringFromName("unableToWrite") + filePath ); 
add: showError(getCalStringBundle().GetStringFromName("unableToWrite") + filePath ); 
context: function saveEventsToFile(calendarEventArray){   if (!calendarEventArray)       return;   if (!calendarEventArray.length)   {      alert(getStringBundle().GetStringFromName("noEventsToSave"));      return;   }   // Show the 'Save As' dialog and ask for a filename to save to   const nsIFilePicker = Components.interfaces.nsIFilePicker;   var fp = Components.classes["@mozilla.org/filepicker;1"]                      .createInstance(nsIFilePicker);   fp.init(window,  getStringBundle().GetStringFromName("SaveAs"),           nsIFilePicker.modeSave);   if(calendarEventArray.length == 1 && calendarEventArray[0].title)      fp.defaultString = calendarEventArray[0].title;   else      fp.defaultString = getStringBundle().GetStringFromName("defaultFileName");   fp.defaultExtension = "ics";   // Get a list of exporters   var contractids = new Array();   var catman = Components.classes["@mozilla.org/categorymanager;1"]                          .getService(Components.interfaces.nsICategoryManager);   var catenum = catman.enumerateCategory('cal-exporters');   while (catenum.hasMoreElements()) {       var entry = catenum.getNext();       entry = entry.QueryInterface(Components.interfaces.nsISupportsCString);       var contractid = catman.getCategoryEntry('cal-exporters', entry);       var exporter = Components.classes[contractid]                                .getService(Components.interfaces.calIExporter);       var types = exporter.getFileTypes({});       var type;       for each (type in types) {           fp.appendFilter(type.description, type.extensionFilter);           contractids.push(contractid);       }   }   fp.show();   // Now find out as what to save, convert the events and save to file.   if (fp.file && fp.file.path.length > 0)    {      const UTF8 = "UTF-8";      var aDataStream;      var extension;      var charset;      var exporter = Components.classes[contractids[fp.filterIndex]]                               .getService(Components.interfaces.calIExporter);      var filePath = fp.file.path;      if(filePath.indexOf(".") == -1 )          filePath += "."+exporter.getFileTypes({})[0].defaultExtension;      const LOCALFILE_CTRID = "@mozilla.org/file/local;1";      const FILEOUT_CTRID = "@mozilla.org/network/file-output-stream;1";      const nsILocalFile = Components.interfaces.nsILocalFile;      const nsIFileOutputStream = Components.interfaces.nsIFileOutputStream;      var outputStream;      var localFileInstance = Components.classes[LOCALFILE_CTRID]                                        .createInstance(nsILocalFile);      localFileInstance.initWithPath(filePath);      outputStream = Components.classes[FILEOUT_CTRID]                               .createInstance(nsIFileOutputStream);      try      {         outputStream.init(localFileInstance, MODE_WRONLY | MODE_CREATE | MODE_TRUNCATE, 0664, 0);         // XXX Do the right thing with unicode and stuff. Or, again, should the         //     exporter handle that?         exporter.exportToStream(outputStream, calendarEventArray.length, calendarEventArray);         outputStream.close();      }      catch(ex)      {         showError(getStringBundle().GetStringFromName("unableToWrite") + filePath );      }   }}
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/f5c02c755c91f396f78f1f1c713ea0a0002e4e76/import-export.js/clean/calendar/base/content/import-export.js