rem: var fileLocation = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsIFile); ioService.initFileFromURLSpec(fileLocation, aDocumentURLString); 
add: var fileLocation = ioService.getFileFromURLSpec(aDocumentURLString); 
context: function PromptForSaveLocation(aDoSaveAsText, aEditorType, aMIMEType, ahtmlDocument, aDocumentURLString){  var dialogResult = new Object;  dialogResult.filepickerClick = nsIFilePicker.returnCancel;  dialogResult.resultingURI = "";  dialogResult.resultingLocalFile = null;  var fp = null;  try {    fp = Components.classes["@mozilla.org/filepicker;1"].createInstance(nsIFilePicker);  } catch (e) {}  if (!fp) return dialogResult;  // determine prompt string based on type of saving we'll do  var promptString;  if (aDoSaveAsText || aEditorType == "text")    promptString = GetString("ExportToText");  else    promptString = GetString("SaveDocumentAs")  fp.init(window, promptString, nsIFilePicker.modeSave);  // Set filters according to the type of output  if (aDoSaveAsText)    fp.appendFilters(nsIFilePicker.filterText);  else    fp.appendFilters(nsIFilePicker.filterHTML);  fp.appendFilters(nsIFilePicker.filterAll);  // now let's actually set the filepicker's suggested filename  var suggestedFileName = GetSuggestedFileName(aDocumentURLString, aMIMEType, ahtmlDocument);  if (suggestedFileName)    fp.defaultString = suggestedFileName;  // set the file picker's current directory  // assuming we have information needed (like prior saved location)  try {    var ioService = GetIOService();        var isLocalFile = true;    try {      var docURI = ioService.newURI(aDocumentURLString, window.editorShell.GetDocumentCharacterSet(), null);      isLocalFile = docURI.schemeIs("file");    }    catch (e) {}    var parentLocation = null;    if (isLocalFile)    {      var fileLocation = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsIFile);      ioService.initFileFromURLSpec(fileLocation, aDocumentURLString);  // this asserts if url is not local      parentLocation = fileLocation.parent;    }    if (parentLocation)    {      // Save current filepicker's default location      if ("gFilePickerDirectory" in window)        gFilePickerDirectory = fp.displayDirectory;      fp.displayDirectory = parentLocation;    }    else    {      // Initialize to the last-used directory for the particular type (saved in prefs)      SetFilePickerDirectory(fp, aEditorType);    }  }  catch(e) {}  dialogResult.filepickerClick = fp.show();  if (dialogResult.filepickerClick != nsIFilePicker.returnCancel)  {    // reset urlstring to new save location    dialogResult.resultingURIString = ioService.getURLSpecFromFile(fp.file);    dialogResult.resultingLocalFile = fp.file;    SaveFilePickerDirectory(fp, aEditorType);  }  else if ("gFilePickerDirectory" in window && gFilePickerDirectory)    fp.displayDirectory = gFilePickerDirectory;   return dialogResult;}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/8f0aa5304bea87fa6844870035a748b2e6b2b2c5/ComposerCommands.js/buggy/editor/ui/composer/content/ComposerCommands.js