Public Member Functions

nsIFileProtocolHandler Interface Reference

import "nsIFileProtocolHandler.idl";

Inheritance diagram for nsIFileProtocolHandler:
Collaboration diagram for nsIFileProtocolHandler:

List of all members.

Public Member Functions

nsIURI newFileURI (in nsIFile aFile)
 This method constructs a new file URI.
AUTF8String getURLSpecFromFile (in nsIFile file)
 Converts the nsIFile to the corresponding URL string.
AUTF8String getURLSpecFromActualFile (in nsIFile file)
 Converts the nsIFile to the corresponding URL string.
AUTF8String getURLSpecFromDir (in nsIFile file)
 Converts the nsIFile to the corresponding URL string.
nsIFile getFileFromURLSpec (in AUTF8String url)
 Converts the URL string into the corresponding nsIFile if possible.
nsIURI readURLFile (in nsIFile file)
 Takes a local file and tries to interpret it as an internet shortcut (e.g.

Member Function Documentation

nsIFile nsIFileProtocolHandler::getFileFromURLSpec ( in AUTF8String  url  ) 

Converts the URL string into the corresponding nsIFile if possible.

A local file will be created if the URL string begins with file://.

AUTF8String nsIFileProtocolHandler::getURLSpecFromActualFile ( in nsIFile  file  ) 

Converts the nsIFile to the corresponding URL string.

Should only be called on files which are not directories. Otherwise identical to getURLSpecFromFile, but is usually more efficient. WARNING: This restriction may not be enforced at runtime!

AUTF8String nsIFileProtocolHandler::getURLSpecFromDir ( in nsIFile  file  ) 

Converts the nsIFile to the corresponding URL string.

Should only be called on files which are directories. Otherwise identical to getURLSpecFromFile, but is usually more efficient. WARNING: This restriction may not be enforced at runtime!

AUTF8String nsIFileProtocolHandler::getURLSpecFromFile ( in nsIFile  file  ) 

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. NOTE: Callers should use getURLSpecFromActualFile or getURLSpecFromDirFile if possible, for performance reasons.

nsIURI nsIFileProtocolHandler::newFileURI ( in nsIFile  aFile  ) 

This method constructs a new file URI.

Parameters:
aFile nsIFile
Returns:
reference to a new nsIURI object
nsIURI nsIFileProtocolHandler::readURLFile ( in nsIFile  file  ) 

Takes a local file and tries to interpret it as an internet shortcut (e.g.

.url files on windows).

Parameters:
file The local file to read
Returns:
The URI the file refers to
Exceptions:
NS_ERROR_NOT_AVAILABLE if the OS does not support such files.
NS_ERROR_NOT_AVAILABLE if this file is not an internet shortcut.

The documentation for this interface was generated from the following file: