nsIFileProtocolHandler

IID:255602ea-c31f-4d29-8f35-905ead3f76f4
Inherits From:nsIProtocolHandler

This interface is implemented by the following components:


Methods

nsIFile getFileFromURLSpec ( AUTF8String url ) AUTF8String getURLSpecFromFile ( nsIFile file ) nsIURI newFileURI ( nsIFile file ) nsIURI readURLFile ( nsIFile file )

nsIFile getFileFromURLSpec ( 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://.

Arguments:
url

AUTF8String getURLSpecFromFile ( 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.

Arguments:
file

nsIURI newFileURI ( nsIFile file )

This method constructs a new file URI

Arguments:
file: nsIFile
Returns:
nsIURI object

nsIURI readURLFile ( nsIFile file )

Takes a local file and tries to interpret it as an internet shortcut (e.g. .url files on windows).

Arguments:
file: The local file to read
Returns:
The URI the file refers to

Reference documentation is generated from Mozilla's source.

Add a note User Contributed Notes
No comments available

Copyright © 1999 - 2005 XULPlanet.com