Interface nsIJARURIType

JAR URLs have the following syntax

jar:!/

EXAMPLE: jar:http://www.big.com/blue.jar!/ocean.html

The nsIURL methods operate on the part of the spec.

Hierarchy

Properties

JAREntry: string

Returns the entry specified for this JAR URI (e.g., "ocean.html"). This value may contain %-escaped byte sequences.

JARFile: nsIURI

Returns the root URI (the one for the actual JAR file) for this JAR (e.g., http://www.big.com/blue.jar).

asciiHost: string

The URI host with an ASCII compatible encoding. Follows the IDNA draft spec for converting internationalized domain names (UTF-8) to ASCII for compatibility with existing internet infrasture.

asciiHostPort: string

The host:port (or simply the host, if port == -1), with an ASCII compatible encoding. Host portion follows the IDNA draft spec. The result is strictly ASCII.

asciiSpec: string

Additional attributes: The URI spec with an ASCII compatible encoding. Host portion follows the IDNA draft spec. Other parts are URL-escaped per the rules of RFC2396. The result is strictly ASCII.

directory: string

The URL path is broken down into the following principal components:

attribute AUTF8String filePath; attribute AUTF8String query;

These are inherited from nsIURI.


The URL filepath is broken down into the following sub-components: Returns the directory portion of a URL. If the URL denotes a path to a directory and not a file, e.g. http://host/foo/bar/, then the Directory attribute accesses the complete /foo/bar/ portion, and the FileName is the empty string. If the trailing slash is omitted, then the Directory is /foo/ and the file is bar (i.e. this is a syntactic, not a semantic breakdown of the Path). And hence don't rely on this for something to be a definitely be a file. But you can get just the leading directory portion for sure.

Some characters may be escaped.

displayHost: string

If the URI has a punycode encoded hostname, this will hold the UTF8 representation of that hostname (if that representation doesn't contain blacklisted characters, and the network.IDN_show_punycode pref is false) Otherwise, if the hostname is ASCII, it will return the same as .asciiHost

displayHostPort: string

The displayHost:port (or simply the displayHost, if port == -1).

displayPrePath: string

Returns the same as calling .prePath, only with a UTF8 encoded hostname (if that hostname doesn't contain blacklisted characters, and the network.IDN_show_punycode pref is false)

displaySpec: string

Returns the same as calling .spec, only with a UTF8 encoded hostname (if that hostname doesn't contain blacklisted characters, and the network.IDN_show_punycode pref is false)

fileBaseName: string

The URL filename is broken down even further: Returns the file basename portion of a filename in a url.

Some characters may be escaped.

fileExtension: string

Returns the file extension portion of a filename in a url. If a file extension does not exist, the empty string is returned.

Some characters may be escaped.

fileName: string

Returns the file name portion of a URL. If the URL denotes a path to a directory and not a file, e.g. http://host/foo/bar/, then the Directory attribute accesses the complete /foo/bar/ portion, and the FileName is the empty string. Note that this is purely based on searching for the last trailing slash. And hence don't rely on this to be a definite file.

Some characters may be escaped.

filePath: string

Additional attributes added for .query support: Returns a path including the directory and file portions of a URL. For example, the filePath of "http://host/foo/bar.html#baz" is "/foo/bar.html".

Some characters may be escaped.

hasRef: boolean

Returns if there is a reference portion (the part after the "#") of the URI.

host: string

The host is the internet domain name to which this URI refers. It could be an IPv4 (or IPv6) address literal. Otherwise it is an ASCII or punycode encoded string.

hostPort: string

The host:port (or simply the host, if port == -1).

password: string
pathQueryRef: string

The path, typically including at least a leading '/' (but may also be empty, depending on the protocol).

Some characters may be escaped.

This attribute contains query and ref parts for historical reasons. Use the 'filePath' attribute if you do not want those parts included.

port: number

A port value of -1 corresponds to the protocol's default port (eg. -1 implies port 80 for http URIs).

prePath: string

The prePath (eg. scheme://user:password@host:port) returns the string before the path. This is useful for authentication or managing sessions.

Some characters may be escaped.

query: string

Returns the query portion (the part after the "?") of the URL. If there isn't one, an empty string is returned.

Some characters may be escaped.

ref: string

Additional attribute & methods added for .ref support: Returns the reference portion (the part after the "#") of the URI. If there isn't one, an empty string is returned.

Some characters may be escaped.

scheme: string

The Scheme is the protocol to which this URI refers. The scheme is restricted to the US-ASCII charset per RFC3986.

spec: string

The URI is broken down into the following principal components: Returns a string representation of the URI.

Some characters may be escaped.

specIgnoringRef: string

returns a string for the current URI with the ref element cleared.

userPass: string

The username:password (or username only if value doesn't contain a ':')

Some characters may be escaped.

username: string

The optional username and password, assuming the preHost consists of username:password.

Some characters may be escaped.

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

  • Returns an nsIURIMutator that can be used to make changes to the URI. After performing the setter operations on the mutator, one may call mutator.finalize() to get a new immutable URI with the desired properties.

    Returns nsIURIMutator

  • This method resolves a relative string into an absolute URI string, using this URI as the base.

    NOTE: some implementations may have no concept of a relative URI.

    Parameters

    • relativePath: string

    Returns string

  • An optimization to do scheme checks without requiring the users of nsIURI to GetScheme, thereby saving extra allocating and freeing. Returns true if the schemes match (case ignored).

    Parameters

    • scheme: string

    Returns boolean

  • Serializes a URI object to a URIParams data structure in order for being passed over IPC. For deserialization, see nsIURIMutator.

    Parameters

    • aParams: URIParams

    Returns void

Generated using TypeDoc