rem: var LocalFileComponent; var LocalFileInstance; var FileChannelComponent; var FileChannelInstance; var FileTransportComponent; var FileTransportService; var FileTransport; var FileOutput;   LocalFileComponent = Components.classes["@mozilla.org/file/local;1"]; LocalFileInstance = LocalFileComponent.createInstance(Components.interfaces.nsILocalFile); LocalFileInstance.initWithPath(FilePath); if (!LocalFileInstance.exists()) { try { LocalFileInstance.create(LocalFileInstance.NORMAL_FILE_TYPE, 0644); } catch(ex) { mdebug("Unable to create temporary iCal file"); } }  FileChannelComponent = Components.classes["@mozilla.org/network/local-file-channel;1"]; FileChannelInstance = FileChannelComponent.createInstance(Components.interfaces.nsIFileChannel);  FileTransportComponent = Components.classes["@mozilla.org/network/file-transport-service;1"]; FileTransportService = FileTransportComponent.getService(Components.interfaces.nsIFileTransportService);  FileTransport = FileTransportService.createTransport(LocalFileInstance, FileChannelInstance.NS_RDWR, 0644, true);  FileOutput = FileTransport.openOutputStream(0, -1, null);  FileOutput.write(CalendarStream, CalendarStream.length); FileOutput.close(); 
add: var TempFile = new File( FilePath ); TempFile.open( "w", 0644 ); TempFile.write( CalendarStream ); TempFile.close(); return; 
context: function saveCalendarObject(FilePath, CalendarStream){	var LocalFileComponent;	var LocalFileInstance;	var FileChannelComponent;	var FileChannelInstance;	var FileTransportComponent;	var FileTransportService;	var FileTransport;	var FileOutput;		// need LocalFile, otherwise what are we going to write to?	LocalFileComponent = Components.classes["@mozilla.org/file/local;1"];	LocalFileInstance = LocalFileComponent.createInstance(Components.interfaces.nsILocalFile);	LocalFileInstance.initWithPath(FilePath);	if (!LocalFileInstance.exists())	{		try		{			LocalFileInstance.create(LocalFileInstance.NORMAL_FILE_TYPE, 0644);		}		catch(ex)		{			mdebug("Unable to create temporary iCal file");		}	}	// need nsIFileChannel for ioflags	FileChannelComponent = Components.classes["@mozilla.org/network/local-file-channel;1"];	FileChannelInstance = FileChannelComponent.createInstance(Components.interfaces.nsIFileChannel);	// need nsIFileTransport to create a transport	FileTransportComponent = Components.classes["@mozilla.org/network/file-transport-service;1"];	FileTransportService = FileTransportComponent.getService(Components.interfaces.nsIFileTransportService);	// need nsITransport to open an output stream	FileTransport = FileTransportService.createTransport(LocalFileInstance, FileChannelInstance.NS_RDWR, 0644, true);	// need nsIOutputStream to write out the actual file	FileOutput = FileTransport.openOutputStream(0, -1, null);	// now lets actually write the output to the file	FileOutput.write(CalendarStream, CalendarStream.length);	FileOutput.close();}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/ac09cd478e5ae96e238bbc3b80f50bb13010649d/calendarMail.js/clean/calendar/resources/content/calendarMail.js