Linux Mac OSX Windows

Implemented by


  
[scriptable, uuid(255602ea-c31f-4d29-8f35-905ead3f76f4)]
interface nsIFileProtocolHandler : nsIProtocolHandler

Methods

 Converts the URL string into the corresponding nsIFile if possible.
 A local file will be created if the URL string begins with file://.
nsIFile getFileFromURLSpec(in AUTF8String url)
 Converts the nsIFile to the corresponding URL string.  NOTE: under
 some platforms this is a lossy conversion (e.g., Mac Carbon build).
 If the nsIFile is a local file, then the result will be a file://
 URL string.

 The resulting string may contain URL-escaped characters.
AUTF8String getURLSpecFromFile(in nsIFile file)
 This method constructs a new file URI 

 @param aFile nsIFile
 @return reference to a new nsIURI object
nsIURI newFileURI(in nsIFile aFile)
 Takes a local file and tries to interpret it as an internet shortcut
 (e.g. .url files on windows).
 @param file The local file to read
 @return The URI the file refers to

 @throw NS_ERROR_NOT_AVAILABLE if the OS does not support such files.
 @throw NS_ERROR_NOT_AVAILABLE if this file is not an internet shortcut.
nsIURI readURLFile(in nsIFile file)