Interface nsIFileProtocolHandlerType

Hierarchy

Properties

scheme: string

The scheme of this protocol (e.g., "file").

Methods

  • Increases the reference count for this interface. The associated instance will not be deleted unless the reference count is returned to zero.

    Returns

    The resulting reference count.

    Returns number

  • Parameters

    • aIID: object
    • Optional aInstancePtr: object

    Returns any

  • A run time mechanism for interface discovery.

    Returns

    NS_OK if the interface is supported by the associated instance, NS_NOINTERFACE if it is not.

    aInstancePtr must not be null.

    Parameters

    • aIID: object

      [in] A requested interface IID

    • aInstancePtr: object

      [out] A pointer to an interface pointer to receive the result.

    Returns void

  • Decreases the reference count for this interface. Generally, if the reference count returns to zero, the associated instance is deleted.

    Returns

    The resulting reference count.

    Returns number

  • Allows a protocol to override blacklisted ports.

    This method will be called when there is an attempt to connect to a port that is blacklisted. For example, for most protocols, port 25 (Simple Mail Transfer) is banned. When a URI containing this "known-to-do-bad-things" port number is encountered, this function will be called to ask if the protocol handler wants to override the ban.

    Parameters

    • port: number
    • scheme: string

    Returns boolean

  • Converts the URL string into the corresponding nsIFile if possible. A local file will be created if the URL string begins with file://.

    Parameters

    • url: string

    Returns nsIFile

  • Converts a non-directory 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.

    Should only be called on files which are not directories. If called on directories, the resulting URL may lack a trailing slash and cause relative URLs in such a document to misbehave.

    Parameters

    • file: nsIFile

    Returns string

  • Converts a directory 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.

    Should only be called on files which are directories (will enforce the URL ends with a slash).

    Parameters

    • file: nsIFile

    Returns string

  • DEPRECATED, AVOID IF AT ALL POSSIBLE.

    Calling this will cause IO on the calling thread, to determine if the file is a directory or file, and based on that behaves as if you called getURLSpecFromDir or getURLSpecFromActualFile, respectively. This IO may take multiple seconds (e.g. for network paths, slow external drives that need to be woken up, etc.).

    Usually, the caller should know that the file argument is either a directory (in which case it should call getURLSpecFromDir) or a non-directory file (in which case it should call getURLSpecFromActualFile), and not need to call this method.

    Parameters

    • file: nsIFile

    Returns string

  • Constructs a new channel from the given URI for this protocol handler and sets the loadInfo for the constructed channel.

    Parameters

    • aURI: nsIURI
    • aLoadinfo: nsILoadInfo

    Returns nsIChannel

  • This method constructs a new file URI

    Returns

    reference to a new nsIURI object

    Parameters

    • aFile: nsIFile

      nsIFile

    Returns nsIURI

  • This method constructs a new file URI, and returns a URI mutator that has not yet been finalized, allowing the URI to be changed without being cloned.

    Returns

    reference to a new nsIURIMutator object

    Parameters

    • file: nsIFile

    Returns nsIURIMutator

  • Takes a local file and tries to interpret it as a shell link file (.lnk files on Windows)

    Returns

    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 a shell link.

    Parameters

    • file: nsIFile

      The local file to read

    Returns nsIURI

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

    Returns

    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.

    Parameters

    • file: nsIFile

      The local file to read

    Returns nsIURI

Generated using TypeDoc