rem: items = importer.importStream(inputStream, {}); 
add: items = importer.importFromStream(inputStream, {}); 
context: function loadEventsFromFile(){    const nsIFilePicker = Components.interfaces.nsIFilePicker;      var fp = Components.classes["@mozilla.org/filepicker;1"]                       .createInstance(nsIFilePicker);    fp.init(window, getStringBundle().GetStringFromName("Open"),            nsIFilePicker.modeOpen);    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-importers');    while (catenum.hasMoreElements()) {        var entry = catenum.getNext();        entry = entry.QueryInterface(Components.interfaces.nsISupportsCString);        var contractid = catman.getCategoryEntry('cal-importers', entry);        var exporter = Components.classes[contractid]                                 .getService(Components.interfaces.calIImporter);        var types = exporter.getFileTypes({});        var type;        for each (type in types) {            fp.appendFilter(type.description, "*."+type.extension);            contractids.push(contractid);        }    }    fp.show();    var filePath = fp.file.path;    if (filePath) {        var importer = Components.classes[contractids[fp.filterIndex]]                                 .getService(Components.interfaces.calIImporter);        const nsIFileInputStream = Components.interfaces.nsIFileInputStream;        const nsIScriptableInputStream = Components.interfaces.nsIScriptableInputStream;        var inputStream = Components.classes["@mozilla.org/network/file-input-stream;1"]                                    .createInstance(nsIFileInputStream);        var items;        try        {           inputFromStream.init( fp.file, MODE_RDONLY, 0444, {} );           var scriptableInputStream =                Components.classes["@mozilla.org/scriptableinputstream;1"]                         .createInstance(nsIScriptableInputStream);           scriptableInputStream.init(inputStream);           // XXX Convert the stream to unicode. Or should the importer do that?           items = importer.importStream(inputStream, {});           scriptableInputStream.close();           inputStream.close();        }        catch(ex)        {           alert(getStringBundle().GetStringFromName("unableToRead") + aFilePath + "\n"+ex );        }        // XXX Ask for a calendar to import into        var destCal = getDefaultCalendar();        // XXX This might not work in lighting        startBatchTransaction();                for each (item in items) {            // XXX prompt when finding a duplicate.            destCal.addItem(item, null);        }                // XXX This might not work in lighting        endBatchTransaction();    }    return true;}
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/b53700cfb7c4541e0aa627d489a60194eb8087c4/import-export.js/clean/calendar/base/content/import-export.js