Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

burst.URI Class Reference

List of all members.

Detailed Description

Scoping class for static URI-related utilities; can also be instantiated, if you prefer an OO-model.

Todo:
Add more instance methods.


Public Member Functions

 URI (String uri)
 Construct a URI object from the string url.

String parse (String url)
 Equivalent to calling burst.URI.parse on the string url member of the object.


Static Public Member Functions

Object queryToMap (String s, String dup_handling)
 Parse the url query string (which excludes any leading '?').

Array queryToPairs (String s)
 Parse the query string into an Array of 2-element Arrays.

Array queryToArray (String s)
 Parse the query string into an Array with alternating names and values.

String mapToQuery (Object map)
 Produce a query string (without leading '?') from an associative array.

boolean isAbsolute (String url)
 True if the url is absolute.

String resolveUrl (String url, String base_url, Boolean noabscheck)
 Resolve the url relative to the provide base_url.

String parse (String url)
 Parses the url into an Array of 5 Strings.

String pathSuffix (String url)
 Extracts the path part, and from that the file suffix.

String guessMimeType (String url)
 Guess the MIME type (such as 'text/plain' based on the file suffix in the url (such as '.txt').


Member Function Documentation

String burst.URI.guessMimeType String  url  )  [static]
 

Guess the MIME type (such as 'text/plain' based on the file suffix in the url (such as '.txt').

Returns empty string if can't guess.

String burst.URI.parse String  url  )  [static]
 

Parses the url into an Array of 5 Strings.

scheme ":" "//" net_loc ["/"] path "?" query "#" fragment

  • scheme is non-empty for an absolute url, and null for a relative url. It excludes the ':'.
  • net_loc is non-null if '//' is found, and null if '//' is found. It excludes the '//'.
  • path is always non-null. It includes '/' if present in the URL (it may not be present if scheme and net_loc are missing).
  • query is non-null if '?' is found, and null if not. It excludes the '?'.
  • fragment is non-null if '#' is found, and null if not. It excludes the '#'.

String burst.URI.pathSuffix String  url  )  [static]
 

Extracts the path part, and from that the file suffix.

Returns the empty string if none.

Object burst.URI.queryToMap String  s,
String  dup_handling
[static]
 

Parse the url query string (which excludes any leading '?').

If the same name appears multiple times, the behavior is determined by the dup_handling parameter, which can be: 'first', 'last', 'array', 'error' The default is 'last'

String burst.URI.resolveUrl String  url,
String  base_url,
Boolean  noabscheck
[static]
 

Resolve the url relative to the provide base_url.

The url is just returned if it is already absolute.

RFC2396 specifies relative urls: http://www.faqs.org/rfcs/rfc2396.html This supplants RFC1808.

TBD: As special case, if url starts with '/', and base url is absolute, a url is returned which is made by replacing the base url's pathinfo. This is not valid.

Parameters:
url The url to resolve.
base_url The base url to resolve against
noabscheck Optional. If true, skip checking whether url is already absolute.


The documentation for this class was generated from the following file:
Generated on Tue Nov 30 04:03:08 2004 for BurstProject by doxygen 1.3.4