nsIFile
and nsIURI
. It also provides access to Internet shortcuts stored on the host operating system's file system.
nsIProtocolHandler
Last changed in Gecko 1.9.2 (Firefox 3.6 / Thunderbird 3.1 / Fennec 1.0)nsIFile getFileFromURLSpec(in AUTF8String url); |
AUTF8String getURLSpecFromActualFile(in nsIFile file); |
AUTF8String getURLSpecFromDir(in nsIFile file); |
AUTF8String getURLSpecFromFile(in nsIFile file); |
nsIURI newFileURI(in nsIFile aFile); |
nsIURI readURLFile(in nsIFile file); |
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 );
url
A reference to a new nsIFile
object.
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 getURLSpecFromActualFile( in nsIFile file );
file
nsIFile
to convert.Corresponding url string. The resulting string may contain URL-escaped characters.
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 getURLSpecFromDir( in nsIFile file );
file
nsIFile
to convert.Corresponding url string. The resulting string may contain URL-escaped characters.
Converts the nsIFile
to the corresponding URL string. 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()
if possible, for performance reasons.
AUTF8String getURLSpecFromFile( in nsIFile file );
file
nsIFile
to convert.Corresponding url string. The resulting string may contain URL-escaped characters.
This method constructs a new file URI.
nsIURI newFileURI( in nsIFile aFile );
aFile
nsIFile
to convert.A reference to a new nsIURI
object.
Takes a local file and tries to interpret it as an Internet shortcut (for example .url files on windows).
nsIURI readURLFile( in nsIFile file );
file
nsIFile
to read.The nsIURI
the file refers to.
NS_ERROR_NOT_AVAILABLE
NS_ERROR_NOT_AVAILABLE