# HG changeset patch # User Richard Marti # Date 1502013787 -7200 # Node ID 46e8d4d1250d6196106c5bcf875eb0398fa59cec # Parent 5106d4d9ec3540cc32fffee0d427f0ab0c27f987 Bug 1387813 - Port bug 1375125: Replace nsILocalFile with nsIFile in C-C. r=jorgk diff --git a/calendar/base/content/calendar-dnd-listener.js b/calendar/base/content/calendar-dnd-listener.js --- a/calendar/base/content/calendar-dnd-listener.js +++ b/calendar/base/content/calendar-dnd-listener.js @@ -262,17 +262,17 @@ calDNDBaseObserver.prototype = { let droppedUrl = this.retrieveURLFromData(data, bestFlavor.value); if (!droppedUrl) { return; } let url = Services.io.newURI(droppedUrl); let localFileInstance = Cc["@mozilla.org/file/local;1"] - .createInstance(Ci.nsILocalFile); + .createInstance(Ci.nsIFile); localFileInstance.initWithPath(url.path); let inputStream = Cc["@mozilla.org/network/file-input-stream;1"] .createInstance(Ci.nsIFileInputStream); inputStream.init(localFileInstance, MODE_RDONLY, parseInt("0444", 8), {}); diff --git a/calendar/base/content/dialogs/calendar-migration-dialog.js b/calendar/base/content/dialogs/calendar-migration-dialog.js --- a/calendar/base/content/dialogs/calendar-migration-dialog.js +++ b/calendar/base/content/dialogs/calendar-migration-dialog.js @@ -285,17 +285,17 @@ var gDataMigrator = { aCallback(); } migLOG("Checking for the old calendar extension/app"); let migrators = []; // Look in our current profile directory, in case we're upgrading in // place - let profileDir = this.dirService.get("ProfD", Components.interfaces.nsILocalFile); + let profileDir = this.dirService.get("ProfD", Components.interfaces.nsIFile); profileDir.append("Calendar"); if (profileDir.exists()) { migLOG("Found old extension directory in current app"); let title = "Mozilla Calendar Extension"; migrators.push(new dataMigrator(title, extMigrator, [profileDir])); } // Check the profiles of the various other moz-apps for calendar data diff --git a/calendar/base/content/import-export.js b/calendar/base/content/import-export.js --- a/calendar/base/content/import-export.js +++ b/calendar/base/content/import-export.js @@ -285,22 +285,22 @@ function saveEventsToFile(calendarEventA let exporter = Components.classes[contractids[filterIndex]] .getService(Components.interfaces.calIExporter); let filePath = picker.file.path; if (!filePath.includes(".")) { filePath += "." + exporter.getFileTypes({})[0].defaultExtension; } - const nsILocalFile = Components.interfaces.nsILocalFile; + const nsIFile = Components.interfaces.nsIFile; const nsIFileOutputStream = Components.interfaces.nsIFileOutputStream; let outputStream; let localFileInstance = Components.classes["@mozilla.org/file/local;1"] - .createInstance(nsILocalFile); + .createInstance(nsIFile); localFileInstance.initWithPath(filePath); outputStream = Components.classes["@mozilla.org/network/file-output-stream;1"] .createInstance(nsIFileOutputStream); try { outputStream.init(localFileInstance, MODE_WRONLY | MODE_CREATE | MODE_TRUNCATE, parseInt("0664", 8), diff --git a/calendar/base/content/preferences/alarms.js b/calendar/base/content/preferences/alarms.js --- a/calendar/base/content/preferences/alarms.js +++ b/calendar/base/content/preferences/alarms.js @@ -21,23 +21,23 @@ var gAlarmsPane = { // Set the correct singular/plural for the time units updateMenuLabelsPlural("eventdefalarmlen", "eventdefalarmunit"); updateMenuLabelsPlural("tododefalarmlen", "tododefalarmunit"); updateUnitLabelPlural("defaultsnoozelength", "defaultsnoozelengthunit", "minutes"); }, /** - * Converts the given file url to a nsILocalFile + * Converts the given file url to a nsIFile * * @param aFileURL A string with a file:// url. - * @return The corresponding nsILocalFile. + * @return The corresponding nsIFile. */ convertURLToLocalFile: function(aFileURL) { - // Convert the file url into a nsILocalFile + // Convert the file url into a nsIFile if (aFileURL) { let fph = Services.io .getProtocolHandler("file") .QueryInterface(Components.interfaces.nsIFileProtocolHandler); return fph.getFileFromURLSpec(aFileURL); } else { return null; } diff --git a/calendar/base/src/calCalendarManager.js b/calendar/base/src/calCalendarManager.js --- a/calendar/base/src/calCalendarManager.js +++ b/calendar/base/src/calCalendarManager.js @@ -313,17 +313,17 @@ calCalendarManager.prototype = { flushPrefs(); } finally { selectPrefs.reset(); selectCalendars.reset(); } }, checkAndMigrateDB: function() { - let storageSdb = Services.dirsvc.get("ProfD", Components.interfaces.nsILocalFile); + let storageSdb = Services.dirsvc.get("ProfD", Components.interfaces.nsIFile); storageSdb.append("storage.sdb"); let db = Services.storage.openDatabase(storageSdb); db.beginTransactionAs(Components.interfaces.mozIStorageConnection.TRANSACTION_EXCLUSIVE); try { if (db.tableExists("cal_calendars_prefs")) { // Check if we need to upgrade: let version = this.getSchemaVersion(db); diff --git a/calendar/base/src/calTimezoneService.js b/calendar/base/src/calTimezoneService.js --- a/calendar/base/src/calTimezoneService.js +++ b/calendar/base/src/calTimezoneService.js @@ -510,17 +510,17 @@ function guessSystemTimezone() { return ""; } return varName + "=" + value; } function symbolicLinkTarget(filepath) { try { let file = Components.classes["@mozilla.org/file/local;1"] - .createInstance(Components.interfaces.nsILocalFile); + .createInstance(Components.interfaces.nsIFile); file.initWithPath(filepath); file.QueryInterface(Components.interfaces.nsIFile); if (!file.exists() || !file.isSymlink() || !file.target.match(tzRegex)) { return ""; } return filepath + " -> " + file.target; } catch (ex) { @@ -529,17 +529,17 @@ function guessSystemTimezone() { } } function fileFirstZoneLineString(filepath) { // return first line of file that matches tzRegex (ZoneInfo id), // or "" if no file or no matching line. try { let file = Components.classes["@mozilla.org/file/local;1"] - .createInstance(Components.interfaces.nsILocalFile); + .createInstance(Components.interfaces.nsIFile); file.initWithPath(filepath); file.QueryInterface(Components.interfaces.nsIFile); if (!file.exists()) { return ""; } let fileInstream = Components.classes["@mozilla.org/network/file-input-stream;1"] .createInstance(Components.interfaces.nsIFileInputStream); const PR_RDONLY = 0x1; diff --git a/calendar/lightning/content/lightning-item-iframe.js b/calendar/lightning/content/lightning-item-iframe.js --- a/calendar/lightning/content/lightning-item-iframe.js +++ b/calendar/lightning/content/lightning-item-iframe.js @@ -2007,17 +2007,17 @@ function attachFile(cloudProvider) { filePicker.open(rv => { if (rv != nsIFilePicker.returnOK || !filePicker.files) { return; } let files = filePicker.files; // Create the attachment while (files.hasMoreElements()) { - let file = files.getNext().QueryInterface(Components.interfaces.nsILocalFile); + let file = files.getNext().QueryInterface(Components.interfaces.nsIFile); let fileHandler = Services.io.getProtocolHandler("file") .QueryInterface(Components.interfaces.nsIFileProtocolHandler); let uriSpec = fileHandler.getURLSpecFromFile(file); if (!(uriSpec in gAttachMap)) { // If the attachment hasn't been added, then set the last display // directory. @@ -2044,17 +2044,17 @@ function attachFile(cloudProvider) { * will be returned. * @return The last directory that was set with this function. */ function lastDirectory(aFileUri) { if (aFileUri) { // Act similar to a setter, save the passed uri. let uri = Services.io.newURI(aFileUri); let file = uri.QueryInterface(Components.interfaces.nsIFileURL).file; - lastDirectory.mValue = file.parent.QueryInterface(Components.interfaces.nsILocalFile); + lastDirectory.mValue = file.parent.QueryInterface(Components.interfaces.nsIFile); } // In any case, return the value return (lastDirectory.mValue === undefined ? null : lastDirectory.mValue); } /** * Turns an url into a string that can be used in UI. diff --git a/calendar/providers/ics/calICSCalendar.js b/calendar/providers/ics/calICSCalendar.js --- a/calendar/providers/ics/calICSCalendar.js +++ b/calendar/providers/ics/calICSCalendar.js @@ -674,17 +674,17 @@ calICSCalendar.prototype = { for (let i = 0; i < filteredFiles.length - numBackupFiles; ++i) { let file = backupDir.clone(); file.append(filteredFiles[i].name); try { file.remove(false); } catch (ex) { // This can fail because of some crappy code in - // nsILocalFile. That's not the end of the world. We can + // nsIFile. That's not the end of the world. We can // try to remove the file the next time around. } } } function purgeOldBackups() { // Enumerate files in the backupdir for expiry of old backups let dirEnum = backupDir.directoryEntries; diff --git a/calendar/providers/storage/calStorageCalendar.js b/calendar/providers/storage/calStorageCalendar.js --- a/calendar/providers/storage/calStorageCalendar.js +++ b/calendar/providers/storage/calStorageCalendar.js @@ -202,17 +202,17 @@ calStorageCalendar.prototype = { // migration steps. let localDB = cal.provider.getCalendarDirectory(); localDB.append("local.sqlite"); localDB = Services.storage.openDatabase(localDB); // First, we need to check if this is from 0.9, i.e we need to // migrate from storage.sdb to local.sqlite. - let storageSdb = Services.dirsvc.get("ProfD", Components.interfaces.nsILocalFile); + let storageSdb = Services.dirsvc.get("ProfD", Components.interfaces.nsIFile); storageSdb.append("storage.sdb"); this.mDB = Services.storage.openDatabase(storageSdb); if (this.mDB.tableExists("cal_events")) { cal.LOG("[calStorageCalendar] Migrating storage.sdb -> local.sqlite"); upgradeDB(this.mDB); // upgrade schema before migating data let attachStatement; try { diff --git a/calendar/providers/wcap/calWcapUtils.js b/calendar/providers/wcap/calWcapUtils.js --- a/calendar/providers/wcap/calWcapUtils.js +++ b/calendar/providers/wcap/calWcapUtils.js @@ -30,17 +30,17 @@ function initLogging() { } if (LOG_LEVEL > 0) { let logFileName = getPref("calendar.wcap.log_file", null); if (logFileName) { try { // set up file: let logFile = Components.classes["@mozilla.org/file/local;1"] - .createInstance(Components.interfaces.nsILocalFile); + .createInstance(Components.interfaces.nsIFile); logFile.initWithPath(logFileName); // create output stream: let logFileStream = Components.classes["@mozilla.org/network/file-output-stream;1"] .createInstance(Components.interfaces.nsIFileOutputStream); logFileStream.init(logFile, 0x02 /* PR_WRONLY */ | 0x08 /* PR_CREATE_FILE */ | (getPref("calendar.wcap.log_file_append", false) diff --git a/chat/components/src/imAccounts.js b/chat/components/src/imAccounts.js --- a/chat/components/src/imAccounts.js +++ b/chat/components/src/imAccounts.js @@ -933,17 +933,17 @@ AccountsService.prototype = { if (!("nsICrashReporter" in Ci)) return; try { // Try to get more info with breakpad let lastCrashTime = 0; /* Locate the LastCrash file */ - let lastCrash = Services.dirsvc.get("UAppData", Ci.nsILocalFile); + let lastCrash = Services.dirsvc.get("UAppData", Ci.nsIFile); lastCrash.append("Crash Reports"); lastCrash.append("LastCrash"); if (lastCrash.exists()) { /* Ok, the file exists, now let's try to read it */ let is = Cc["@mozilla.org/network/file-input-stream;1"] .createInstance(Ci.nsIFileInputStream); let sis = Cc["@mozilla.org/scriptableinputstream;1"] .createInstance(Ci.nsIScriptableInputStream); diff --git a/editor/ui/composer/content/ComposerCommands.js b/editor/ui/composer/content/ComposerCommands.js --- a/editor/ui/composer/content/ComposerCommands.js +++ b/editor/ui/composer/content/ComposerCommands.js @@ -1651,17 +1651,17 @@ async function SaveDocument(aSaveAs, aSa var docURI; if (!tempLocalFile) { docURI = Services.io.newURI(urlstring, editor.documentCharacterSet); if (docURI.schemeIs("file")) { var fileHandler = GetFileProtocolHandler(); - tempLocalFile = fileHandler.getFileFromURLSpec(urlstring).QueryInterface(Ci.nsILocalFile); + tempLocalFile = fileHandler.getFileFromURLSpec(urlstring).QueryInterface(Ci.nsIFile); } } // this is the location where the related files will go var relatedFilesDir = null; // Only change links or move files if pref is set // and we are saving to a new location @@ -1708,17 +1708,17 @@ async function SaveDocument(aSaveAs, aSa success = false; } if (success) { try { if (doUpdateURI) { - // If a local file, we must create a new uri from nsILocalFile + // If a local file, we must create a new uri from nsIFile if (tempLocalFile) docURI = GetFileProtocolHandler().newFileURI(tempLocalFile); // We need to set new document uri before notifying listeners SetDocumentURI(docURI); } // Update window title to show possibly different filename diff --git a/editor/ui/composer/content/editorUtilities.js b/editor/ui/composer/content/editorUtilities.js --- a/editor/ui/composer/content/editorUtilities.js +++ b/editor/ui/composer/content/editorUtilities.js @@ -432,36 +432,36 @@ function SetFilePickerDirectory(filePick { if (filePicker) { try { // Save current directory so we can reset it in SaveFilePickerDirectory gFilePickerDirectory = filePicker.displayDirectory; let location = Services.prefs.getComplexValue("editor.lastFileLocation."+fileType, - Ci.nsILocalFile); + Ci.nsIFile); if (location) filePicker.displayDirectory = location; } catch(e) {} } } // Save the directory of the selected file to prefs function SaveFilePickerDirectory(filePicker, fileType) { if (filePicker && filePicker.file) { try { var fileDir; if (filePicker.file.parent) - fileDir = filePicker.file.parent.QueryInterface(Ci.nsILocalFile); + fileDir = filePicker.file.parent.QueryInterface(Ci.nsIFile); Services.prefs.setComplexValue("editor.lastFileLocation." + fileType, - Ci.nsILocalFile, fileDir); + Ci.nsIFile, fileDir); Services.prefs.savePrefFile(null); } catch (e) {} } // Restore the directory used before SetFilePickerDirectory was called; // This reduces interference with Browser and other module directory defaults if (gFilePickerDirectory) diff --git a/mail/base/content/folderPane.js b/mail/base/content/folderPane.js --- a/mail/base/content/folderPane.js +++ b/mail/base/content/folderPane.js @@ -753,17 +753,17 @@ var gFolderTreeView = { // Don't allow drop onto server itself. if (targetFolder.isServer) return false; // Don't allow drop into a folder that cannot take messages. if (!targetFolder.canFileMessages) return false; for (let i = 0; i < dt.mozItemCount; i++) { let extFile = dt.mozGetDataAt("application/x-moz-file", i) - .QueryInterface(Ci.nsILocalFile); + .QueryInterface(Ci.nsIFile); return extFile.isFile(); } } return false; }, drop: function ftv_drop(aRow, aOrientation) { let targetFolder = gFolderTreeView._rowMap[aRow]._folder; @@ -839,17 +839,17 @@ var gFolderTreeView = { else if (feedUri) { Cc["@mozilla.org/newsblog-feed-downloader;1"] .getService(Ci.nsINewsBlogFeedDownloader) .subscribeToFeed(feedUri.spec, targetFolder, msgWindow); } else if (types.includes("application/x-moz-file")) { for (let i = 0; i < count; i++) { let extFile = dt.mozGetDataAt("application/x-moz-file", i) - .QueryInterface(Ci.nsILocalFile); + .QueryInterface(Ci.nsIFile); if (extFile.isFile()) { let len = extFile.leafName.length; if (len > 4 && extFile.leafName.toLowerCase().endsWith(".eml")) cs.CopyFileMessage(extFile, targetFolder, null, false, 1, "", null, msgWindow); } } } }, diff --git a/mail/base/content/mailCore.js b/mail/base/content/mailCore.js --- a/mail/base/content/mailCore.js +++ b/mail/base/content/mailCore.js @@ -746,17 +746,17 @@ nsFlavorDataProvider.prototype = urlPrimitive, dataSize); var srcUrlPrimitive = urlPrimitive.value.QueryInterface(Ci.nsISupportsString); // now get the destination file location from kFilePromiseDirectoryMime var dirPrimitive = {}; aTransferable.getTransferData("application/x-moz-file-promise-dir", dirPrimitive, dataSize); - var destDirectory = dirPrimitive.value.QueryInterface(Ci.nsILocalFile); + var destDirectory = dirPrimitive.value.QueryInterface(Ci.nsIFile); // now save the attachment to the specified location // XXX: we need more information than just the attachment url to save it, // fortunately, we have an array of all the current attachments so we can // cheat and scan through them var attachment = null; for (let index of currentAttachments.keys()) diff --git a/mail/base/content/msgMail3PaneWindow.js b/mail/base/content/msgMail3PaneWindow.js --- a/mail/base/content/msgMail3PaneWindow.js +++ b/mail/base/content/msgMail3PaneWindow.js @@ -1383,17 +1383,17 @@ messageFlavorDataProvider.prototype = { let fileUriStr = fileUriPrimitive.value.QueryInterface(Ci.nsISupportsString); let fileUri = Services.io.newURI(fileUriStr.data); let fileUrl = fileUri.QueryInterface(Ci.nsIURL); let fileName = fileUrl.fileName; let destDirPrimitive = {}; aTransferable.getTransferData("application/x-moz-file-promise-dir", destDirPrimitive, dataSize); - let destDirectory = destDirPrimitive.value.QueryInterface(Ci.nsILocalFile); + let destDirectory = destDirPrimitive.value.QueryInterface(Ci.nsIFile); let file = destDirectory.clone(); file.append(fileName); let messageUriPrimitive = {}; aTransferable.getTransferData("text/x-moz-message", messageUriPrimitive, dataSize); let messageUri = messageUriPrimitive.value.QueryInterface(Ci.nsISupportsString); messenger.saveAs(messageUri.data, true, null, decodeURIComponent(file.path), true); diff --git a/mail/base/modules/MailUtils.js b/mail/base/modules/MailUtils.js --- a/mail/base/modules/MailUtils.js +++ b/mail/base/modules/MailUtils.js @@ -42,17 +42,17 @@ var MailUtils = /** * Get the nsIMsgFolder corresponding to this file. This just looks at all * folders and does a direct match. * * One of the places this is used is desktop search integration -- to open * the search result corresponding to a mozeml/wdseml file, we need to figure * out the folder using the file's path. * - * @param aFile the nsILocalFile to convert to a folder + * @param aFile the nsIFile to convert to a folder * @returns the nsIMsgFolder corresponding to aFile, or null if the folder * isn't found */ getFolderForFileInProfile: function MailUtils_getFolderForFileInProfile(aFile) { let folders = MailServices.accounts.allFolders; for (let folder of fixIterator(folders, Ci.nsIMsgFolder)) { diff --git a/mail/base/modules/mailMigrator.js b/mail/base/modules/mailMigrator.js --- a/mail/base/modules/mailMigrator.js +++ b/mail/base/modules/mailMigrator.js @@ -315,17 +315,17 @@ var MailMigrator = { Services.prefs.getBoolPref("editor.CR_creates_new_p")); Services.prefs.clearUserPref("editor.CR_creates_new_p"); } // Migrate remote content exceptions for email addresses which are // encoded as chrome URIs. if (currentUIVersion < 14) { let permissionsDB = - Services.dirsvc.get("ProfD",Ci.nsILocalFile); + Services.dirsvc.get("ProfD", Ci.nsIFile); permissionsDB.append("permissions.sqlite"); let db = Services.storage.openDatabase(permissionsDB); try { let statement = db.createStatement( "select origin,permission from moz_perms where " + // Avoid 'like' here which needs to be escaped. "substr(origin, 1, 28)='chrome://messenger/content/?';"); diff --git a/mail/components/about-support/content/aboutSupport.js b/mail/components/about-support/content/aboutSupport.js --- a/mail/components/about-support/content/aboutSupport.js +++ b/mail/components/about-support/content/aboutSupport.js @@ -1185,17 +1185,17 @@ Serializer.prototype = { function openProfileDirectory() { // Get the profile directory. let currProfD = Services.dirsvc.get("ProfD", Ci.nsIFile); let profileDir = currProfD.path; // Show the profile directory. let nsLocalFile = Components.Constructor("@mozilla.org/file/local;1", - "nsILocalFile", "initWithPath"); + "nsIFile", "initWithPath"); new nsLocalFile(profileDir).reveal(); } /** * Profile reset is only supported for the default profile if the appropriate migrator exists. */ function populateActionBox() { if (ResetProfile.resetSupported()) { diff --git a/mail/components/cloudfile/nsBox.js b/mail/components/cloudfile/nsBox.js --- a/mail/components/cloudfile/nsBox.js +++ b/mail/components/cloudfile/nsBox.js @@ -173,17 +173,17 @@ nsBox.prototype = { } else this._uploader = null; }, /** * Attempt to upload a file to Box's servers. * - * @param aFile an nsILocalFile for uploading. + * @param aFile an nsIFile for uploading. * @param aCallback an nsIRequestObserver for monitoring the start and * stop states of the upload procedure. */ uploadFile: function nsBox_uploadFile(aFile, aCallback) { if (Services.io.offline) throw Ci.nsIMsgCloudFileProvider.offlineErr; this.log.info("uploading " + aFile.leafName); @@ -233,17 +233,17 @@ nsBox.prototype = { onGetUserInfoSuccess(); }, /** * A private function called when we're almost ready to kick off the upload * for a file. First, ensures that the file size is not too large, and that * we won't exceed our storage quota, and then kicks off the upload. * - * @param aFile the nsILocalFile to upload + * @param aFile the nsIFile to upload * @param aCallback the nsIRequestObserver for monitoring the start and stop * states of the upload procedure. */ _finishUpload: function nsBox__finishUpload(aFile, aCallback) { let exceedsFileLimit = Ci.nsIMsgCloudFileProvider.uploadExceedsFileLimit; let exceedsQuota = Ci.nsIMsgCloudFileProvider.uploadWouldExceedQuota; if (aFile.fileSize > this._maxFileSize) return aCallback.onStopRequest(null, null, exceedsFileLimit); @@ -262,17 +262,17 @@ nsBox.prototype = { this._uploadingFile = aFile; this._uploader.uploadFile(); }, /** * Cancels an in-progress file upload. * - * @param aFile the nsILocalFile being uploaded. + * @param aFile the nsIFile being uploaded. */ cancelFileUpload: function nsBox_cancelFileUpload(aFile) { if (this._uploadingFile.equals(aFile)) { this._uploader.cancel(); } else { for (let i = 0; i < this._uploads.length; i++) if (this._uploads[i].file.equals(aFile)) { @@ -374,17 +374,17 @@ nsBox.prototype = { return this.logon(function() { this._getUserInfo(aSuccessCallback, aFailureCallback); }.bind(this), aFailureCallback, aWithUI); }, /** * Returns the sharing URL for some uploaded file. * - * @param aFile the nsILocalFile to get the URL for. + * @param aFile the nsIFile to get the URL for. */ urlForFile: function nsBox_urlForFile(aFile) { return this._urlsForFiles[aFile.path]; }, /** * Updates the profile information for the account associated with the * account key. @@ -589,17 +589,17 @@ nsBox.prototype = { */ get fileUploadSizeLimit() { return this._maxFileSize; }, get remainingFileSpace() { return this._totalStorage - this._fileSpaceUsed; }, get fileSpaceUsed() { return this._fileSpaceUsed; }, /** * Attempts to delete an uploaded file. * - * @param aFile the nsILocalFile to delete. + * @param aFile the nsIFile to delete. * @param aCallback an nsIRequestObserver for monitoring the start and stop * states of the delete procedure. */ deleteFile: function nsBox_deleteFile(aFile, aCallback) { this.log.info("Deleting a file"); if (Services.io.offline) { this.log.error("We're offline - we can't delete the file."); diff --git a/mail/components/cloudfile/nsHightail.js b/mail/components/cloudfile/nsHightail.js --- a/mail/components/cloudfile/nsHightail.js +++ b/mail/components/cloudfile/nsHightail.js @@ -161,17 +161,17 @@ nsHightail.prototype = { } else this._uploader = null; }, /** * Attempt to upload a file to Hightail's servers. * - * @param aFile an nsILocalFile for uploading. + * @param aFile an nsIFile for uploading. * @param aCallback an nsIRequestObserver for monitoring the start and * stop states of the upload procedure. */ uploadFile: function(aFile, aCallback) { if (Services.io.offline) throw Ci.nsIMsgCloudFileProvider.offlineErr; this.log.info("Preparing to upload a file"); @@ -218,17 +218,17 @@ nsHightail.prototype = { onGetUserInfoSuccess(); }, /** * A private function called when we're almost ready to kick off the upload * for a file. First, ensures that the file size is not too large, and that * we won't exceed our storage quota, and then kicks off the upload. * - * @param aFile the nsILocalFile to upload + * @param aFile the nsIFile to upload * @param aCallback the nsIRequestObserver for monitoring the start and stop * states of the upload procedure. */ _finishUpload: function(aFile, aCallback) { if (aFile.fileSize > 2147483648) return this._fileExceedsLimit(aCallback, '2GB', 0); if (aFile.fileSize > this._maxFileSize) return this._fileExceedsLimit(aCallback, 'Limit', 0); @@ -268,17 +268,17 @@ nsHightail.prototype = { args).focus(); return aCallback.onStopRequest(null, null, cancel); }, /** * Cancels an in-progress file upload. * - * @param aFile the nsILocalFile being uploaded. + * @param aFile the nsIFile being uploaded. */ cancelFileUpload: function(aFile) { this.log.info("in cancel upload"); if (this._uploadingFile != null && this._uploader != null && this._uploadingFile.equals(aFile)) { this._uploader.cancel(); } else { @@ -384,17 +384,17 @@ nsHightail.prototype = { req.setRequestHeader("X-Api-Key", kApiKey); req.setRequestHeader("Accept", "application/json"); req.send(); }, /** * Returns the sharing URL for some uploaded file. * - * @param aFile the nsILocalFile to get the URL for. + * @param aFile the nsIFile to get the URL for. */ urlForFile: function(aFile) { return this._urlsForFiles[aFile.path]; }, /** * Attempts to refresh cached profile information for the account associated * with this instance's account key. @@ -656,17 +656,17 @@ nsHightail.prototype = { get remainingFileSpace() { return this._availableStorage; }, get fileSpaceUsed() { return this._fileSpaceUsed; }, /** * Attempts to delete an uploaded file. * - * @param aFile the nsILocalFile to delete. + * @param aFile the nsIFile to delete. * @param aCallback an nsIRequestObserver for monitoring the start and stop * states of the delete procedure. */ deleteFile: function(aFile, aCallback) { this.log.info("Deleting a file"); if (Services.io.offline) { this.log.error("We're offline - we can't delete the file."); diff --git a/mail/components/compose/content/MsgComposeCommands.js b/mail/components/compose/content/MsgComposeCommands.js --- a/mail/components/compose/content/MsgComposeCommands.js +++ b/mail/components/compose/content/MsgComposeCommands.js @@ -2523,19 +2523,19 @@ function ComposeStartup(aParams) Services.prompt.alert(null, title, msg); } } } if (args.newshost) composeFields.newshost = args.newshost; if (args.message) { let msgFile = Cc["@mozilla.org/file/local;1"] - .createInstance(Ci.nsILocalFile); + .createInstance(Ci.nsIFile); if (OS.Path.dirname(args.message) == ".") { - let workingDir = Services.dirsvc.get("CurWorkD", Ci.nsILocalFile); + let workingDir = Services.dirsvc.get("CurWorkD", Ci.nsIFile); args.message = OS.Path.join(workingDir.path, OS.Path.basename(args.message)); } msgFile.initWithPath(args.message); if (!msgFile.exists()) { let title = getComposeBundle().getString("errorFileMessageTitle"); let msg = getComposeBundle().getFormattedString("errorFileMessageMessage", [args.message]); @@ -4007,17 +4007,17 @@ function GetLastAttachDirectory() // this will fail the first time we attach a file // as we won't have a pref value. lastDirectory = null; } return lastDirectory; } -// attachedLocalFile must be a nsILocalFile +// attachedLocalFile must be a nsIFile function SetLastAttachDirectory(attachedLocalFile) { try { let file = attachedLocalFile.QueryInterface(Ci.nsIFile); let parent = file.parent.QueryInterface(Ci.nsIFile); Services.prefs.setComplexValue(kComposeAttachDirPrefName, Ci.nsIFile, parent); @@ -4051,19 +4051,19 @@ function AttachFile() attachments.push(FileToAttachment(file)); AddAttachments(attachments); SetLastAttachDirectory(file); }); } /** - * Convert an nsILocalFile instance into an nsIMsgAttachment. + * Convert an nsIFile instance into an nsIMsgAttachment. * - * @param file the nsILocalFile + * @param file the nsIFile * @return an attachment pointing to the file */ function FileToAttachment(file) { let fileHandler = Services.io.getProtocolHandler("file") .QueryInterface(Ci.nsIFileProtocolHandler); let attachment = Cc["@mozilla.org/messengercompose/attachment;1"] .createInstance(Ci.nsIMsgAttachment); diff --git a/mail/components/nsMailDefaultHandler.js b/mail/components/nsMailDefaultHandler.js --- a/mail/components/nsMailDefaultHandler.js +++ b/mail/components/nsMailDefaultHandler.js @@ -390,17 +390,17 @@ var nsMailDefaultHandler = { // This must be a regular filename. Use it to create a new message with attachment. let msgParams = Cc["@mozilla.org/messengercompose/composeparams;1"] .createInstance(Ci.nsIMsgComposeParams); let composeFields = Cc["@mozilla.org/messengercompose/composefields;1"] .createInstance(Ci.nsIMsgCompFields); let attachment = Cc["@mozilla.org/messengercompose/attachment;1"] .createInstance(Ci.nsIMsgAttachment); let localFile = Cc["@mozilla.org/file/local;1"] - .createInstance(Ci.nsILocalFile); + .createInstance(Ci.nsIFile); let fileHandler = Services.io.getProtocolHandler("file") .QueryInterface(Ci.nsIFileProtocolHandler); try { // Unescape the URI so that we work with clients that escape spaces. localFile.initWithPath(unescape(uri)); attachment.url = fileHandler.getURLSpecFromFile(localFile); composeFields.addAttachment(attachment); diff --git a/mail/components/preferences/chat.js b/mail/components/preferences/chat.js --- a/mail/components/preferences/chat.js +++ b/mail/components/preferences/chat.js @@ -27,17 +27,17 @@ var gChatPane = { if (document.getElementById("messenger.status.awayWhenIdle").value) textbox.removeAttribute("disabled"); else textbox.setAttribute("disabled", "true"); }, convertURLToLocalFile: function(aFileURL) { - // convert the file url into a nsILocalFile + // convert the file url into a nsIFile if (aFileURL) { return Services.io.getProtocolHandler("file") .QueryInterface(Ci.nsIFileProtocolHandler) .getFileFromURLSpec(aFileURL); } return null; }, diff --git a/mail/components/preferences/downloads.js b/mail/components/preferences/downloads.js --- a/mail/components/preferences/downloads.js +++ b/mail/components/preferences/downloads.js @@ -8,27 +8,26 @@ var gDownloadDirSection = { { const nsIFilePicker = Ci.nsIFilePicker; var fp = Cc["@mozilla.org/filepicker;1"] .createInstance(nsIFilePicker); var bundlePreferences = document.getElementById("bundlePreferences"); var title = bundlePreferences.getString("chooseAttachmentsFolderTitle"); fp.init(window, title, nsIFilePicker.modeGetFolder); - const nsILocalFile = Ci.nsIFile; var customDirPref = document.getElementById("browser.download.dir"); if (customDirPref.value) fp.displayDirectory = customDirPref.value; fp.appendFilters(nsIFilePicker.filterAll); fp.open(rv => { if (rv != nsIFilePicker.returnOK || !fp.file) { return; } - let file = fp.file.QueryInterface(nsIFile); + let file = fp.file.QueryInterface(Ci.nsIFile); let currentDirPref = document.getElementById("browser.download.downloadDir"); customDirPref.value = currentDirPref.value = file; let folderListPref = document.getElementById("browser.download.folderList"); folderListPref.value = this._fileToIndex(file); }); }, onReadUseDownloadDir: function () @@ -77,17 +76,17 @@ var gDownloadDirSection = { return "UsrDocs"; return "Home"; }, _getDownloadsFolder: function (aFolder) { let dir = Services.dirsvc.get(this._getSpecialFolderKey(aFolder), - Ci.nsILocalFile); + Ci.nsIFile); if (aFolder != "Desktop") dir.append("My Downloads"); return dir; }, readDownloadDirPref: function () { diff --git a/mail/components/preferences/general.js b/mail/components/preferences/general.js --- a/mail/components/preferences/general.js +++ b/mail/components/preferences/general.js @@ -71,17 +71,17 @@ var gGeneralPane = { document.documentElement .openSubDialog("chrome://messenger/content/preferences/dockoptions.xul", "", null); } }, convertURLToLocalFile: function(aFileURL) { - // convert the file url into a nsILocalFile + // convert the file url into a nsIFile if (aFileURL) { return Services.io .getProtocolHandler("file") .QueryInterface(Ci.nsIFileProtocolHandler) .getFileFromURLSpec(aFileURL); } else diff --git a/mail/components/search/SpotlightIntegration.js b/mail/components/search/SpotlightIntegration.js --- a/mail/components/search/SpotlightIntegration.js +++ b/mail/components/search/SpotlightIntegration.js @@ -47,28 +47,28 @@ var SearchIntegration = /// Spotlight won't index files in the profile dir, but will use ~/Library/Caches/Metadata _getSearchPathForFolder: function spotlight_get_search_path(aFolder) { // Swap the metadata dir for the profile dir prefix in the folder's path let folderPath = aFolder.filePath.path; let fixedPath = folderPath.replace(this._profileDir.path, this._metadataDir.path); let searchPath = Cc["@mozilla.org/file/local;1"] - .createInstance(Ci.nsILocalFile); + .createInstance(Ci.nsIFile); searchPath.initWithPath(fixedPath); return searchPath; }, /// Replace ~/Library/Caches/Metadata with the profile directory, then convert _getFolderForSearchPath: function spotlight_get_folder_for_search_path(aPath) { let folderPath = aPath.path.replace(this._metadataDir.path, this._profileDir.path); let folderFile = Cc["@mozilla.org/file/local;1"] - .createInstance(Ci.nsILocalFile); + .createInstance(Ci.nsIFile); folderFile.initWithPath(folderPath); return MailUtils.getFolderForFileInProfile(folderFile); }, _pathNeedsReindexing: function spotlight_pathNeedsReindexing(aPath) { // We used to set permissions incorrectly (see bug 670566). const PERM_DIRECTORY = parseInt("0755", 8); if (aPath.permissions != PERM_DIRECTORY) { diff --git a/mail/components/wintaskbar/windowsJumpLists.js b/mail/components/wintaskbar/windowsJumpLists.js --- a/mail/components/wintaskbar/windowsJumpLists.js +++ b/mail/components/wintaskbar/windowsJumpLists.js @@ -148,17 +148,17 @@ var WinTaskbarJumpList = { this._builder.deleteActiveList(); }, /** * Jump list item creation helpers */ _createHandlerAppItem: function WTBJL__createHandlerAppItem(aTask) { - let file = Services.dirsvc.get("XCurProcD", Ci.nsILocalFile); + let file = Services.dirsvc.get("XCurProcD", Ci.nsIFile); // XXX where can we grab this from in the build? Do we need to? file.append("thunderbird.exe"); let handlerApp = Cc["@mozilla.org/uriloader/local-handler-app;1"] .createInstance(Ci.nsILocalHandlerApp); handlerApp.executable = file; // handlers default to the leaf name if a name is not specified diff --git a/mail/test/mozmill/cloudfile/test-cloudfile-attachment-item.js b/mail/test/mozmill/cloudfile/test-cloudfile-attachment-item.js --- a/mail/test/mozmill/cloudfile/test-cloudfile-attachment-item.js +++ b/mail/test/mozmill/cloudfile/test-cloudfile-attachment-item.js @@ -110,17 +110,17 @@ function test_upload_multiple_and_cancel * ensuring that the nsIMsgCloduFileProvider.uploadCanceled status message * is returned to the passed in listener. * * @param aController the compose window controller to use. * @param aProvider a MockCloudfileAccount for which the uploads have already * started. * @param aListener the nsIRequestObserver passed to aProvider's uploadFile * function. - * @param aTargetFile the nsILocalFile to cancel the upload for. + * @param aTargetFile the nsIFile to cancel the upload for. */ function assert_can_cancel_upload(aController, aProvider, aListener, aTargetFile) { let cancelled = false; // Override the provider's cancelFileUpload function. We can do this because // it's assumed that the provider is a MockCloudfileAccount. aProvider.cancelFileUpload = function(aFileToCancel) { @@ -151,20 +151,20 @@ function assert_can_cancel_upload(aContr // Close the popup, and wait for the cancellation to be complete. close_popup(aController, aController.eid(kAttachmentItemContextID)); aController.waitFor(() => cancelled); } /** * A helper function to find the attachment bucket index for a particular - * nsILocalFile. Returns null if no attachmentitem is found. + * nsIFile. Returns null if no attachmentitem is found. * * @param aController the compose window controller to use. - * @param aFile the nsILocalFile to search for. + * @param aFile the nsIFile to search for. */ function get_attachmentitem_index_for_file(aController, aFile) { // Get the fileUrl from the file. let fileUrl = aController.window.FileToAttachment(aFile).url; // Get the bucket, and go through each item looking for the matching // attachmentitem. let bucket = aController.e("attachmentBucket"); diff --git a/mail/test/mozmill/shared-modules/test-cloudfile-helpers.js b/mail/test/mozmill/shared-modules/test-cloudfile-helpers.js --- a/mail/test/mozmill/shared-modules/test-cloudfile-helpers.js +++ b/mail/test/mozmill/shared-modules/test-cloudfile-helpers.js @@ -49,17 +49,17 @@ function installInto(module) { function getFile(aFilename, aRoot) { let path = os.getFileForPath(aRoot); let file = os.getFileForPath(os.abspath(aFilename, path)); fdh.assert_true(file.exists, "File " + aFilename + " does not exist."); return file; } /** - * Helper function for getting the nsILocalFile's for some files located + * Helper function for getting the nsIFile's for some files located * in a subdirectory of the test directory. * * @param aFiles an array of filename strings for files underneath the test * file directory. * @param aFileRoot the file who's parent directory we should start looking * for aFiles in. * * Example: diff --git a/mail/test/mozmill/shared-modules/test-folder-display-helpers.js b/mail/test/mozmill/shared-modules/test-folder-display-helpers.js --- a/mail/test/mozmill/shared-modules/test-folder-display-helpers.js +++ b/mail/test/mozmill/shared-modules/test-folder-display-helpers.js @@ -2846,17 +2846,17 @@ var SyntheticPartMultiRelated; function load_via_src_path(aPath, aModule) { let thisFilePath = os.getFileForPath(__file__); for (let i = 0; i < FILE_LOAD_PATHS.length; ++i) { let srcPath = os.abspath(FILE_LOAD_PATHS[i], thisFilePath); let fullPath = os.abspath(aPath, os.getFileForPath(srcPath)); let file = Cc["@mozilla.org/file/local;1"] - .createInstance(Ci.nsILocalFile); + .createInstance(Ci.nsIFile); file.initWithPath(fullPath); if (file.exists()) { try { let uri = Services.io.newFileURI(file).spec; Services.scriptloader.loadSubScript(uri, aModule); return; } diff --git a/mail/test/resources/mozmill/mozmill/extension/resource/modules/frame.js b/mail/test/resources/mozmill/mozmill/extension/resource/modules/frame.js --- a/mail/test/resources/mozmill/mozmill/extension/resource/modules/frame.js +++ b/mail/test/resources/mozmill/mozmill/extension/resource/modules/frame.js @@ -83,17 +83,17 @@ var loadTestResources = function () { if (elementslib == undefined) { elementslib = {}; Cu.import("resource://mozmill/modules/elementslib.js", elementslib); } } var loadFile = function(path, collector) { var file = Cc["@mozilla.org/file/local;1"] - .createInstance(Ci.nsILocalFile); + .createInstance(Ci.nsIFile); file.initWithPath(path); var uri = ios.newFileURI(file).spec; var module = new Cu.Sandbox(systemPrincipal, { wantGlobalProperties: ["ChromeUtils"] }); module.registeredFunctions = registeredFunctions; module.collector = collector loadTestResources(); module.mozmill = mozmill; @@ -343,17 +343,17 @@ function Collector () { Collector.prototype.getModule = function (name) { return this.test_modules_by_name[name]; } Collector.prototype.getServer = function (port, basePath) { if (basePath) { var lp = Cc["@mozilla.org/file/local;1"] - .createInstance(Ci.nsILocalFile); + .createInstance(Ci.nsIFile); lp.initWithPath(basePath); } var srv = new HttpServer(); if (lp) { srv.registerDirectory("/", lp); } @@ -391,17 +391,17 @@ Collector.prototype.addHttpResource = fu if (!ns) { ns = '/'; } else { ns = '/' + ns + '/'; } var lp = Cc["@mozilla.org/file/local;1"] - .createInstance(Ci.nsILocalFile); + .createInstance(Ci.nsIFile); lp.initWithPath(os.abspath(directory, this.current_file)); this.httpd.registerDirectory(ns, lp); return 'http://localhost:' + this.http_port + ns } Collector.prototype.initTestModule = function (filename) { var test_module = loadFile(filename, this); @@ -714,12 +714,12 @@ var getThread = function () { return thread; } function registerModule(name, path) { let protocolHandler = Services.io.getProtocolHandler("resource") .QueryInterface(Ci.nsIResProtocolHandler); let modulesFile = Cc["@mozilla.org/file/local;1"] - .createInstance(Ci.nsILocalFile); + .createInstance(Ci.nsIFile); modulesFile.initWithPath(path); protocolHandler.setSubstitution(name, ios.newFileURI(modulesFile)); } diff --git a/mail/test/resources/mozmill/mozmill/extension/resource/modules/utils.js b/mail/test/resources/mozmill/mozmill/extension/resource/modules/utils.js --- a/mail/test/resources/mozmill/mozmill/extension/resource/modules/utils.js +++ b/mail/test/resources/mozmill/mozmill/extension/resource/modules/utils.js @@ -247,17 +247,17 @@ var runFile = function(w) { resolve({path:thefile.path, data:data}); }); }); }; var getFile = function(path){ //define the file interface var file = Cc["@mozilla.org/file/local;1"] - .createInstance(Ci.nsILocalFile); + .createInstance(Ci.nsIFile); //point it at the file we want to get at file.initWithPath(path); // define file stream interfaces var data = ""; var fstream = Cc["@mozilla.org/network/file-input-stream;1"] .createInstance(Ci.nsIFileInputStream); var sstream = Cc["@mozilla.org/scriptableinputstream;1"] .createInstance(Ci.nsIScriptableInputStream); diff --git a/mail/test/resources/mozmill/mozmill/extension/resource/stdlib/httpd.js b/mail/test/resources/mozmill/mozmill/extension/resource/stdlib/httpd.js --- a/mail/test/resources/mozmill/mozmill/extension/resource/stdlib/httpd.js +++ b/mail/test/resources/mozmill/mozmill/extension/resource/stdlib/httpd.js @@ -2213,17 +2213,17 @@ function ServerHandler(server) // FIELDS /** * The nsHttpServer instance associated with this handler. */ this._server = server; /** - * A FileMap object containing the set of path->nsILocalFile mappings for + * A FileMap object containing the set of path->nsIFile mappings for * all directory mappings set in the server (e.g., "/" for /var/www/html/, * "/foo/bar/" for /local/path/, and "/foo/bar/baz/" for /local/path2). * * Note carefully: the leading and trailing "/" in each path (not file) are * removed before insertion to simplify the code which uses this. You have * been warned! */ this._pathDirectoryMap = new FileMap(); @@ -2646,17 +2646,17 @@ ServerHandler.prototype = }, /** * Writes an HTTP response for the given file, including setting headers for * file metadata. * * @param metadata : Request * the Request for which a response is being generated - * @param file : nsILocalFile + * @param file : nsIFile * the file which is to be sent in the response * @param response : Response * the response to which the file should be written * @param offset: uint * the byte offset to skip to when writing * @param count: uint * the number of bytes to write */ @@ -2985,27 +2985,27 @@ ServerHandler.prototype = } catch (e) { return "application/octet-stream"; } }, /** - * Returns the nsILocalFile which corresponds to the path, as determined using + * Returns the nsIFile which corresponds to the path, as determined using * all registered path->directory mappings and any paths which are explicitly * overridden. * * @param path : string * the server path for which a file should be retrieved, e.g. "/foo/bar" * @throws HttpError * when the correct action is the corresponding HTTP error (i.e., because no * mapping was found for a directory in path, the referenced file doesn't * exist, etc.) - * @returns nsILocalFile + * @returns nsIFile * the file to be sent as the response to a request for the path */ _getFileForPath: function(path) { // decode and add underscores as necessary try { path = toInternalPath(path, true); @@ -3360,51 +3360,51 @@ ServerHandler.prototype = response.bodyOutputStream.write(body, body.length); } } }; /** - * Maps absolute paths to files on the local file system (as nsILocalFiles). + * Maps absolute paths to files on the local file system (as nsIFiles). */ function FileMap() { - /** Hash which will map paths to nsILocalFiles. */ + /** Hash which will map paths to nsIFiles. */ this._map = {}; } FileMap.prototype = { // PUBLIC API /** - * Maps key to a clone of the nsILocalFile value if value is non-null; + * Maps key to a clone of the nsIFile value if value is non-null; * otherwise, removes any extant mapping for key. * * @param key : string * string to which a clone of value is mapped - * @param value : nsILocalFile + * @param value : nsIFile * the file to map to key, or null to remove a mapping */ put: function(key, value) { if (value) this._map[key] = value.clone(); else delete this._map[key]; }, /** - * Returns a clone of the nsILocalFile mapped to key, or null if no such + * Returns a clone of the nsIFile mapped to key, or null if no such * mapping exists. * * @param key : string * key to which the returned file maps - * @returns nsILocalFile + * @returns nsIFile * a clone of the mapped file, or null if no mapping exists */ get: function(key) { var val = this._map[key]; return val ? val.clone() : null; } }; @@ -5258,17 +5258,17 @@ var NSGetFactory = XPCOMUtils.generateNS * /home/jwalden/index.html); if this is omitted, only the default URLs in * this server implementation will be functional */ function server(port, basePath) { if (basePath) { var lp = Cc["@mozilla.org/file/local;1"] - .createInstance(Ci.nsILocalFile); + .createInstance(Ci.nsIFile); lp.initWithPath(basePath); } // if you're running this, you probably want to see debugging info DEBUG = true; var srv = new nsHttpServer(); if (lp) diff --git a/mail/test/resources/mozmill/mozmill/extension/resource/stdlib/os.js b/mail/test/resources/mozmill/mozmill/extension/resource/stdlib/os.js --- a/mail/test/resources/mozmill/mozmill/extension/resource/stdlib/os.js +++ b/mail/test/resources/mozmill/mozmill/extension/resource/stdlib/os.js @@ -47,17 +47,17 @@ function listDirectory (file) { entry.QueryInterface(Ci.nsIFile); array.push(entry); } return array; } function getFileForPath (path) { var file = Cc["@mozilla.org/file/local;1"] - .createInstance(Ci.nsILocalFile); + .createInstance(Ci.nsIFile); file.initWithPath(path); return file; } function abspath (rel, file) { var relSplit = rel.split('/'); if (relSplit[0] == '..' && !file.isDirectory()) { file = file.parent; diff --git a/mailnews/base/prefs/content/removeAccount.js b/mailnews/base/prefs/content/removeAccount.js --- a/mailnews/base/prefs/content/removeAccount.js +++ b/mailnews/base/prefs/content/removeAccount.js @@ -55,17 +55,17 @@ function enableRemove() { !document.getElementById("removeData").checked); } /** * Show the local directory. */ function openLocalDirectory() { let nsLocalFile = Components.Constructor("@mozilla.org/file/local;1", - "nsILocalFile", "initWithPath"); + "nsIFile", "initWithPath"); let localDir = gServer.localPath.path; try { new nsLocalFile(localDir).reveal(); } catch(e) { // Reveal may fail e.g. on Linux, then just show the path as a string. document.getElementById("localDirectory").value = localDir; document.getElementById("localDirectory").collapsed = false; } diff --git a/mailnews/base/test/unit/test_searchBody.js b/mailnews/base/test/unit/test_searchBody.js --- a/mailnews/base/test/unit/test_searchBody.js +++ b/mailnews/base/test/unit/test_searchBody.js @@ -153,38 +153,38 @@ function fixFile(file) { data += str; str = sstream.read(4096); } while (str.length > 0); sstream.close(); fstream.close(); let targetFile = Cc["@mozilla.org/file/local;1"] - .createInstance(Ci.nsILocalFile); + .createInstance(Ci.nsIFile); targetFile.initWithFile(do_get_profile()); targetFile.append(file.leafName); let ostream = Cc["@mozilla.org/network/file-output-stream;1"] .createInstance(Ci.nsIFileOutputStream); ostream.init(targetFile, -1, -1, 0); ostream.write(data, data.length); ostream.close(); return targetFile; } -var copyListener = +var copyListener = { OnStartCopy: function() {}, OnProgress: function(aProgress, aProgressMax) {}, SetMessageKey: function(aKey) {}, SetMessageId: function(aMessageId) {}, - OnStopCopy: function(aStatus) + OnStopCopy: function(aStatus) { var fileName = Files.shift(); if (fileName) - { + { var file = fixFile(do_get_file(fileName)); MailServices.copy.CopyFileMessage(file, localAccountUtils.inboxFolder, null, false, 0, "", copyListener, null); } else testBodySearch(); } }; diff --git a/mailnews/compose/test/unit/test_bug235432.js b/mailnews/compose/test/unit/test_bug235432.js --- a/mailnews/compose/test/unit/test_bug235432.js +++ b/mailnews/compose/test/unit/test_bug235432.js @@ -38,17 +38,17 @@ var gCopyListener = } }; /** * copyFileMessageInLocalFolder * A utility wrapper of nsIMsgCopyService.CopyFileMessage to copy a message * into local inbox folder. * - * @param aMessageFile An instance of nsILocalFile to copy. + * @param aMessageFile An instance of nsIFile to copy. * @param aMessageFlags Message flags which will be set after message is * copied * @param aMessageKeyword Keywords which will be set for newly copied * message * @param aMessageWindow Window for notification callbacks, can be null * @param aCallback Callback function which will be invoked after * message is copied */ diff --git a/mailnews/db/gloda/modules/datastore.js b/mailnews/db/gloda/modules/datastore.js --- a/mailnews/db/gloda/modules/datastore.js +++ b/mailnews/db/gloda/modules/datastore.js @@ -489,17 +489,17 @@ ExplainedStatementWrapper.prototype = { function ExplainedStatementProcessor(aDumpPath) { Services.obs.addObserver(this, "quit-application"); this._sqlStack = []; this._curOps = []; this._objsWritten = 0; let filePath = Cc["@mozilla.org/file/local;1"] - .createInstance(Ci.nsILocalFile); + .createInstance(Ci.nsIFile); filePath.initWithPath(aDumpPath); this._ostream = Cc["@mozilla.org/network/file-output-stream;1"] .createInstance(Ci.nsIFileOutputStream); this._ostream.init(filePath, -1, -1, 0); let s = '{"queries": ['; this._ostream.write(s, s.length); diff --git a/mailnews/extensions/bayesian-spam-filter/test/unit/resources/trainingfile.js b/mailnews/extensions/bayesian-spam-filter/test/unit/resources/trainingfile.js --- a/mailnews/extensions/bayesian-spam-filter/test/unit/resources/trainingfile.js +++ b/mailnews/extensions/bayesian-spam-filter/test/unit/resources/trainingfile.js @@ -24,17 +24,17 @@ function TrainingData() { this.mJunkMessages = 0; this.mGoodCounts = new Object; this.mJunkCounts = new Object; // helper functions function getJunkStatFile() { var sBaseDir = Services.dirsvc.get("ProfD", Ci.nsIFile); - var CFileByFile = new CC("@mozilla.org/file/local;1", "nsILocalFile", "initWithFile"); + var CFileByFile = new CC("@mozilla.org/file/local;1", "nsIFile", "initWithFile"); var oFile = new CFileByFile(sBaseDir); oFile.append("training.dat"); return oFile; } function getBinStream(oFile) { if (oFile && oFile.exists()) diff --git a/mailnews/extensions/newsblog/content/feed-subscriptions.js b/mailnews/extensions/newsblog/content/feed-subscriptions.js --- a/mailnews/extensions/newsblog/content/feed-subscriptions.js +++ b/mailnews/extensions/newsblog/content/feed-subscriptions.js @@ -2537,17 +2537,17 @@ var FeedSubscriptions = { this.clearStatusInfo(); } }, /** * Import opml file into a feed account. Used by the Subscribe dialog and * the Import wizard. * - * @param nsILocalFile aFile - the opml file. + * @param nsIFile aFile - the opml file. * @param nsIMsgIncomingServer aServer - the account server. * @param func aCallback - callback function. * * @return bool - false if error. */ importOPMLFile: function(aFile, aServer, aCallback) { if (aServer && (aServer instanceof Ci.nsIMsgIncomingServer)) diff --git a/mailnews/local/test/unit/head_maillocal.js b/mailnews/local/test/unit/head_maillocal.js --- a/mailnews/local/test/unit/head_maillocal.js +++ b/mailnews/local/test/unit/head_maillocal.js @@ -70,17 +70,17 @@ var gCopyListener = } }; /** * copyFileMessageInLocalFolder * A utility wrapper of nsIMsgCopyService.CopyFileMessage to copy a message * into local inbox folder. * - * @param aMessageFile An instance of nsILocalFile to copy. + * @param aMessageFile An instance of nsIFile to copy. * @param aMessageFlags Message flags which will be set after message is * copied * @param aMessageKeyword Keywords which will be set for newly copied * message * @param aMessageWindow Window for notification callbacks, can be null * @param aCallback Callback function which will be invoked after * message is copied */ diff --git a/suite/base/content/utilityOverlay.js b/suite/base/content/utilityOverlay.js --- a/suite/base/content/utilityOverlay.js +++ b/suite/base/content/utilityOverlay.js @@ -170,28 +170,27 @@ function GetLocalizedStringPref(aPrefNam Cu.reportError("Couldn't get " + aPrefName + " pref: " + e); } return aDefaultValue; } function GetLocalFilePref(aName) { try { - return Services.prefs.getComplexValue(aName, - Ci.nsILocalFile); + return Services.prefs.getComplexValue(aName, Ci.nsIFile); } catch (e) {} return null; } /** * Returns the Desktop folder. */ function GetDesktopFolder() { - return Services.dirsvc.get("Desk", Ci.nsILocalFile); + return Services.dirsvc.get("Desk", Ci.nsIFile); } /** * Returns the relevant nsIFile directory. */ function GetSpecialDirectory(aName) { return Services.dirsvc.get(aName, Ci.nsIFile); @@ -1901,17 +1900,17 @@ function GetFileFromString(aString) // If empty string just return null. if (!aString) return null; let commandLine = Cc["@mozilla.org/toolkit/command-line;1"] .createInstance(Ci.nsICommandLine); let uri = commandLine.resolveURI(aString); return uri instanceof Ci.nsIFileURL ? - uri.file.QueryInterface(Ci.nsILocalFile) : null; + uri.file.QueryInterface(Ci.nsIFile) : null; } function CopyImage() { var param = Cc["@mozilla.org/embedcomp/command-params;1"] .createInstance(Ci.nsICommandParams); param.setLongValue("imageCopy", Ci.nsIContentViewerEdit.COPY_IMAGE_ALL); diff --git a/suite/browser/nsBrowserContentHandler.js b/suite/browser/nsBrowserContentHandler.js --- a/suite/browser/nsBrowserContentHandler.js +++ b/suite/browser/nsBrowserContentHandler.js @@ -356,17 +356,17 @@ var nsBrowserContentHandler = { // prevent this handle all url command line flag and set the command line's // preventDefault to true to prevent the display of the ui. The initial // command line will be retained when nsAppRunner calls LaunchChild though // urls launched after the initial launch will be lost. try { // This will throw when a profile has not been selected. var fl = Cc["@mozilla.org/file/directory_service;1"] .getService(Ci.nsIProperties); - fl.get("ProfD", Ci.nsILocalFile); + fl.get("ProfD", Ci.nsIFile); } catch (e) { cmdLine.preventDefault = true; throw Cr.NS_ERROR_ABORT; } try { var urlParam = cmdLine.handleFlagWithParam("url", false); if (urlParam) { diff --git a/suite/components/downloads/tests/chrome/test_basic_functionality.xul b/suite/components/downloads/tests/chrome/test_basic_functionality.xul --- a/suite/components/downloads/tests/chrome/test_basic_functionality.xul +++ b/suite/components/downloads/tests/chrome/test_basic_functionality.xul @@ -201,17 +201,17 @@ function test_properDownloadData(aWin) break; } is(view.getCellText(i, colState), stateString, "Download states match up"); var filePath = ioSvc.newURI(DownloadData[i].target) .QueryInterface(Ci.nsIFileURL) .file.clone() - .QueryInterface(Ci.nsILocalFile) + .QueryInterface(Ci.nsIFile) .path; is(statusBar.label, filePath, "Download targets match up"); is(view.getCellText(i, colSource), DownloadData[i].source, "Download sources match up"); } } diff --git a/suite/components/feeds/FeedConverter.js b/suite/components/feeds/FeedConverter.js --- a/suite/components/feeds/FeedConverter.js +++ b/suite/components/feeds/FeedConverter.js @@ -358,17 +358,17 @@ FeedResultService.prototype = { addToClientReader: function addToClientReader(spec, title, subtitle, feedType) { var handler = safeGetCharPref(getPrefActionForType(feedType), "reader"); if (handler == "ask" || handler == "reader") handler = safeGetCharPref(getPrefReaderForType(feedType), "messenger"); switch (handler) { case "client": var clientApp = Services.prefs.getComplexValue(getPrefAppForType(feedType), - Ci.nsILocalFile); + Ci.nsIFile); // For the benefit of applications that might know how to deal with more // URLs than just feeds, send feed: URLs in the following format: // // http urls: replace scheme with feed, e.g. // http://foo.com/index.rdf -> feed://foo.com/index.rdf // other urls: prepend feed: scheme, e.g. // https://foo.com/index.rdf -> feed:https://foo.com/index.rdf diff --git a/suite/components/feeds/FeedWriter.js b/suite/components/feeds/FeedWriter.js --- a/suite/components/feeds/FeedWriter.js +++ b/suite/components/feeds/FeedWriter.js @@ -776,17 +776,17 @@ FeedWriter.prototype = { handlers[0].doCommand(); } break; case "client": try { this._selectedApp = Services.prefs.getComplexValue(getPrefAppForType(feedType), - Ci.nsILocalFile); + Ci.nsIFile); } catch(ex) { this._selectedApp = null; } if (this._selectedApp) { this._initMenuItemWithFile(this._selectedAppMenuItem, this._selectedApp); @@ -842,17 +842,17 @@ FeedWriter.prototype = { // Last-selected application var menuItem = liveBookmarksMenuItem.cloneNode(false); menuItem.removeAttribute("selected"); menuItem.setAttribute("anonid", "selectedAppMenuItem"); menuItem.className = "menuitem-iconic selectedAppMenuItem"; menuItem.setAttribute("handlerType", "client"); try { this._selectedApp = Services.prefs.getComplexValue(getPrefAppForType(feedType), - Ci.nsILocalFile); + Ci.nsIFile); if (this._selectedApp.exists()) this._initMenuItemWithFile(menuItem, this._selectedApp); else { // Hide the menuitem if the last selected application doesn't exist menuItem.hidden = true; } } diff --git a/suite/components/nsSuiteGlue.js b/suite/components/nsSuiteGlue.js --- a/suite/components/nsSuiteGlue.js +++ b/suite/components/nsSuiteGlue.js @@ -435,17 +435,17 @@ SuiteGlue.prototype = { if (currentUIVersion < 1) { // Run any migrations due prior to 2.49. this._updatePrefs(); this._migrateDownloadPrefs(); // Migrate remote content exceptions for email addresses which are // encoded as chrome URIs. let permissionsDB = - Services.dirsvc.get("ProfD", Ci.nsILocalFile); + Services.dirsvc.get("ProfD", Ci.nsIFile); permissionsDB.append("permissions.sqlite"); let db = Services.storage.openDatabase(permissionsDB); try { let statement = db.createStatement( "select origin, permission from moz_perms where " + // Avoid 'like' here which needs to be escaped. " substr(origin, 1, 28) = 'chrome://messenger/content/?';"); @@ -541,17 +541,17 @@ SuiteGlue.prototype = { }, // Copies additional profile files from the default profile tho the current profile. // Only files not covered by the regular profile creation process. // Currently only the userchrome examples. _copyDefaultProfileFiles: function() { // Copy default chrome example files if they do not exist in the current profile. - var profileDir = Services.dirsvc.get("ProfD", Ci.nsILocalFile); + var profileDir = Services.dirsvc.get("ProfD", Ci.nsIFile); profileDir.append("chrome"); // The chrome directory in the current/new profile already exists so no copying. if (profileDir.exists()) return; let defaultProfileDir = Services.dirsvc.get("DefRt", Ci.nsIFile); @@ -1193,23 +1193,23 @@ SuiteGlue.prototype = { { // Migration of download-manager preferences if (Services.prefs.getPrefType("browser.download.dir") == Services.prefs.PREF_INVALID || Services.prefs.getPrefType("browser.download.lastDir") != Services.prefs.PREF_INVALID) return; //Do nothing if .dir does not exist, or if it exists and lastDir does not try { Services.prefs.setComplexValue("browser.download.lastDir", - Ci.nsILocalFile, + Ci.nsIFile, Services.prefs.getComplexValue("browser.download.dir", - Ci.nsILocalFile)); + Ci.nsIFile)); } catch (ex) { // Ensure that even if we don't end up migrating to a lastDir that we // don't attempt another update. This will throw when QI'ed to - // nsILocalFile, but it does fallback gracefully. + // nsIFile, but it does fallback gracefully. Services.prefs.setCharPref("browser.download.lastDir", ""); } try { Services.prefs.setBoolPref("browser.download.useDownloadDir", Services.prefs.getBoolPref("browser.download.autoDownload")); } catch (ex) {} diff --git a/suite/components/places/content/places.js b/suite/components/places/content/places.js --- a/suite/components/places/content/places.js +++ b/suite/components/places/content/places.js @@ -456,17 +456,17 @@ var PlacesOrganizer = { /** * Called when 'Choose File...' is selected from the restore menu. * Prompts for a file and restores bookmarks to those in the file. */ onRestoreBookmarksFromFile: function PO_onRestoreBookmarksFromFile() { let dirSvc = Cc["@mozilla.org/file/directory_service;1"]. getService(Ci.nsIProperties); - let backupsDir = dirSvc.get("Desk", Ci.nsILocalFile); + let backupsDir = dirSvc.get("Desk", Ci.nsIFile); let fp = Cc["@mozilla.org/filepicker;1"].createInstance(Ci.nsIFilePicker); let fpCallback = aResult => { if (aResult != Ci.nsIFilePicker.returnCancel) { this.restoreBookmarksFromFile(fp.file.path); } }; fp.init(window, PlacesUIUtils.getString("bookmarksRestoreTitle"), @@ -518,17 +518,17 @@ var PlacesOrganizer = { /** * Backup bookmarks to desktop, auto-generate a filename with a date. * The file is a JSON serialization of bookmarks, tags and any annotations * of those items. */ backupBookmarks: function PO_backupBookmarks() { let dirSvc = Cc["@mozilla.org/file/directory_service;1"]. getService(Ci.nsIProperties); - let backupsDir = dirSvc.get("Desk", Ci.nsILocalFile); + let backupsDir = dirSvc.get("Desk", Ci.nsIFile); let fp = Cc["@mozilla.org/filepicker;1"].createInstance(Ci.nsIFilePicker); let fpCallback = function fpCallback_done(aResult) { if (aResult != Ci.nsIFilePicker.returnCancel) { // There is no OS.File version of the filepicker yet (Bug 937812). PlacesBackups.saveBookmarksToJSONFile(fp.file.path); } }; diff --git a/suite/components/pref/content/pref-applications.js b/suite/components/pref/content/pref-applications.js --- a/suite/components/pref/content/pref-applications.js +++ b/suite/components/pref/content/pref-applications.js @@ -51,17 +51,17 @@ const PREF_HIDE_PLUGINS_WITHOUT_EXTENSIO * checkbox is unchecked, corresponds to when browser.feeds.handler=="ask") * or more permanently (i.e., the item displayed in the dropdown in Feeds * preferences) * * browser.feeds.handler.webservice * - the URL of the currently selected web service used to read feeds * * browser.feeds.handlers.application - * - nsILocalFile, stores the current client-side feed reading app if one has + * - nsIFile, stores the current client-side feed reading app if one has * been chosen */ const PREF_FEED_SELECTED_APP = "browser.feeds.handlers.application"; const PREF_FEED_SELECTED_WEB = "browser.feeds.handlers.webservice"; const PREF_FEED_SELECTED_ACTION = "browser.feeds.handler"; const PREF_FEED_SELECTED_READER = "browser.feeds.handler.default"; const PREF_VIDEO_FEED_SELECTED_APP = "browser.videoFeeds.handlers.application"; @@ -1224,18 +1224,17 @@ var gApplicationsPane = { if (aHandlerApp instanceof Ci.nsIGIOMimeApp) return aHandlerApp.command; return false; }, _isValidHandlerExecutable(aExecutable) { - var file = Services.dirsvc.get("XREExeF", - Ci.nsILocalFile); + var file = Services.dirsvc.get("XREExeF", Ci.nsIFile); return aExecutable && aExecutable.exists() && aExecutable.isExecutable() && aExecutable.leafName != file.leafName; }, /** * Rebuild the actions menu for the selected entry. Gets called by diff --git a/suite/components/sessionstore/nsSessionStartup.js b/suite/components/sessionstore/nsSessionStartup.js --- a/suite/components/sessionstore/nsSessionStartup.js +++ b/suite/components/sessionstore/nsSessionStartup.js @@ -52,18 +52,17 @@ SessionStartup.prototype = { /* ........ Global Event Handlers .............. */ /** * Initialize the component */ init: function sss_init() { // get file references - let sessionFile = Services.dirsvc.get("ProfD", - Ci.nsILocalFile); + let sessionFile = Services.dirsvc.get("ProfD", Ci.nsIFile); sessionFile.append("sessionstore.json"); let doResumeSession = Services.prefs.getBoolPref("browser.sessionstore.resume_session_once") || Services.prefs.getIntPref("browser.startup.page") == 3; var resumeFromCrash = Services.prefs.getBoolPref("browser.sessionstore.resume_from_crash"); // only continue if the session file exists diff --git a/suite/components/sessionstore/nsSessionStore.js b/suite/components/sessionstore/nsSessionStore.js --- a/suite/components/sessionstore/nsSessionStore.js +++ b/suite/components/sessionstore/nsSessionStore.js @@ -220,17 +220,17 @@ SessionStoreService.prototype = { this._prefBranch.getIntPref("sessionstore.max_concurrent_tabs"); this._prefBranch.addObserver("sessionstore.max_concurrent_tabs", this, true); // Make sure gRestoreTabsProgressListener has a reference to sessionstore // so that it can make calls back in gRestoreTabsProgressListener.ss = this; // get file references - this._sessionFile = Services.dirsvc.get("ProfD", Ci.nsILocalFile); + this._sessionFile = Services.dirsvc.get("ProfD", Ci.nsIFile); this._sessionFileBackup = this._sessionFile.clone(); this._sessionFile.append("sessionstore.json"); this._sessionFileBackup.append("sessionstore.bak"); // get string containing session state var ss = Cc["@mozilla.org/suite/sessionstartup;1"] .getService(Ci.nsISessionStartup); try { diff --git a/suite/components/tests/browser/browser_346337.js b/suite/components/tests/browser/browser_346337.js --- a/suite/components/tests/browser/browser_346337.js +++ b/suite/components/tests/browser/browser_346337.js @@ -2,22 +2,22 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ function test() { /** Test for Bug 346337 **/ var file = Cc["@mozilla.org/file/directory_service;1"] .getService(Ci.nsIProperties) - .get("TmpD", Ci.nsILocalFile); + .get("TmpD", Ci.nsIFile); file.append("346337_test1.file"); let filePath1 = file.path; file = Cc["@mozilla.org/file/directory_service;1"] .getService(Ci.nsIProperties) - .get("TmpD", Ci.nsILocalFile); + .get("TmpD", Ci.nsIFile); file.append("346337_test2.file"); let filePath2 = file.path; let fieldList = { "//input[@name='input']": Date.now().toString(), "//input[@name='spaced 1']": Math.random().toString(), "//input[3]": "three", "//input[@type='checkbox']": true, diff --git a/suite/components/tests/browser/browser_466937.js b/suite/components/tests/browser/browser_466937.js --- a/suite/components/tests/browser/browser_466937.js +++ b/suite/components/tests/browser/browser_466937.js @@ -4,17 +4,17 @@ function test() { /** Test for Bug 466937 **/ waitForExplicitFinish(); var file = Cc["@mozilla.org/file/directory_service;1"] .getService(Ci.nsIProperties) - .get("TmpD", Ci.nsILocalFile); + .get("TmpD", Ci.nsIFile); file.append("466937_test.file"); let testPath = file.path; let testURL = "http://mochi.test:8888/browser/" + "suite/common/tests/browser/browser_466937_sample.html"; let tab = getBrowser().addTab(testURL); let window = tab.ownerDocument.defaultView; diff --git a/suite/mailnews/components/compose/content/MsgComposeCommands.js b/suite/mailnews/components/compose/content/MsgComposeCommands.js --- a/suite/mailnews/components/compose/content/MsgComposeCommands.js +++ b/suite/mailnews/components/compose/content/MsgComposeCommands.js @@ -2394,25 +2394,25 @@ function SetContentAndBodyAsUnmodified() function MsgComposeCloseWindow() { if (gMsgCompose) gMsgCompose.CloseWindow(); else window.close(); } -// attachedLocalFile must be a nsILocalFile +// attachedLocalFile must be a nsIFile function SetLastAttachDirectory(attachedLocalFile) { try { var file = attachedLocalFile.QueryInterface(Ci.nsIFile); - var parent = file.parent.QueryInterface(Ci.nsILocalFile); + var parent = file.parent.QueryInterface(Ci.nsIFile); Services.prefs.setComplexValue(kComposeAttachDirPrefName, - Ci.nsILocalFile, parent); + Ci.nsIFile, parent); } catch (ex) { dump("error: SetLastAttachDirectory failed: " + ex + "\n"); } } function AttachFile() { @@ -2446,17 +2446,17 @@ function AttachFile() function AttachFiles(attachments) { if (!attachments || !attachments.hasMoreElements()) return null; var firstAttachedFile = null; while (attachments.hasMoreElements()) { - var currentFile = attachments.getNext().QueryInterface(Ci.nsILocalFile); + var currentFile = attachments.getNext().QueryInterface(Ci.nsIFile); if (!firstAttachedFile) { firstAttachedFile = currentFile; } var fileHandler = Services.io.getProtocolHandler("file").QueryInterface(Ci.nsIFileProtocolHandler); var currentAttachment = fileHandler.getURLSpecFromFile(currentFile); diff --git a/suite/mailnews/content/messengerdnd.js b/suite/mailnews/content/messengerdnd.js --- a/suite/mailnews/content/messengerdnd.js +++ b/suite/mailnews/content/messengerdnd.js @@ -228,17 +228,17 @@ function DropOnFolderTree(aRow, aOrienta gCopyService.CopyMessages(sourceFolder, array, targetFolder, isMove, null, msgWindow, true); } else if (types.includes("application/x-moz-file")) { for (let i = 0; i < count; i++) { let extFile = dt.mozGetDataAt("application/x-moz-file", i) - .QueryInterface(Ci.nsILocalFile); + .QueryInterface(Ci.nsIFile); if (extFile.isFile() && /\.eml$/i.test(extFile.leafName)) gCopyService.CopyFileMessage(extFile, targetFolder, null, false, 1, "", null, msgWindow); } } else if (types.includes("text/x-moz-url")) { // This is a potential RSS feed to subscribe to diff --git a/suite/mailnews/content/msgHdrViewOverlay.js b/suite/mailnews/content/msgHdrViewOverlay.js --- a/suite/mailnews/content/msgHdrViewOverlay.js +++ b/suite/mailnews/content/msgHdrViewOverlay.js @@ -1964,17 +1964,17 @@ nsFlavorDataProvider.prototype = var dataSize = { }; aTransferable.getTransferData("application/x-moz-file-promise-url", urlPrimitive, dataSize); var srcUrlPrimitive = urlPrimitive.value.QueryInterface(Ci.nsISupportsString); // now get the destination file location from kFilePromiseDirectoryMime var dirPrimitive = {}; aTransferable.getTransferData("application/x-moz-file-promise-dir", dirPrimitive, dataSize); - var destDirectory = dirPrimitive.value.QueryInterface(Ci.nsILocalFile); + var destDirectory = dirPrimitive.value.QueryInterface(Ci.nsIFile); // now save the attachment to the specified location // XXX: we need more information than just the attachment url to save it, fortunately, we have an array // of all the current attachments so we can cheat and scan through them var attachment = null; for (let index in currentAttachments) { diff --git a/suite/modules/WindowsJumpLists.jsm b/suite/modules/WindowsJumpLists.jsm --- a/suite/modules/WindowsJumpLists.jsm +++ b/suite/modules/WindowsJumpLists.jsm @@ -406,17 +406,17 @@ var WinTaskbarJumpList = /** * Jump list item creation helpers */ _getHandlerAppItem: function WTBJL__getHandlerAppItem(name, description, args, iconIndex, faviconPageUri) { - var file = Services.dirsvc.get("XREExeF", Ci.nsILocalFile); + var file = Services.dirsvc.get("XREExeF", Ci.nsIFile); var handlerApp = Cc["@mozilla.org/uriloader/local-handler-app;1"]. createInstance(Ci.nsILocalHandlerApp); handlerApp.executable = file; // handlers default to the leaf name if a name is not specified if (name && name.length != 0) handlerApp.name = name; handlerApp.detailedDescription = description;