rem: saveDataToFile( calendarToGet.path, request.responseText, "UTF-8" ); 
add: saveDataToFile( calendarToGet.getAttribute( "http: 
context: function onResponseAndRefresh( ){   //check to make sure this is a real calendar file first.   //if its not, it causes Mozilla to crash.   if( request.responseText.indexOf( "BEGIN:VCALENDAR" ) == -1 )   {      alert( "The calendar "+calendarToGet.name+" is not a valid iCalendar file." );      gCalendarWindow.calendarManager.deleteCalendar( calendarToGet );      saveDataToFile( calendarToGet.path, "", "UTF-8" );      return;   }   //save the stream to a file.   saveDataToFile( calendarToGet.path, request.responseText, "UTF-8" );      gCalendarWindow.calendarManager.removeCalendar( calendarToGet );   if( calendarToGet.active )      gCalendarWindow.calendarManager.addCalendar( calendarToGet );   refreshEventTree( false );   refreshToDoTree( false );   gCalendarWindow.currentView.refreshEvents();   document.getElementById( "calendar-list-image-"+calendarToGet.serverNumber ).removeAttribute( "synching" );}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/a8db41c3cf2888eb555ad13d4c2651f31f85a4d3/calendarManager.js/clean/calendar/resources/content/calendarManager.js