Class zebkit.URI <zebkit>

URI class. Pass either a full uri (as a string or zebkit.URI) or number of an URI parts (scheme, host, etc) to construct it.

Constructor:
zebkit.URI ([uri], [scheme], [host], [port], [path], [qs])

Parameters:



public void appendQS (obj)
public <zebkit.URI> getParent ( )
public <Boolean> isAbsolute ( )
public static <Boolean> isAbsolute (u)
public <Boolean> isFilePath ( )
public static <Boolean> isURL (u)
public static <String> join (p)
public <String> join (p)
public static <Object> parseQS (url, [decode])
public static <String> relative (base, path)
public <String> relative (to)
public static <String> toQS (obj, [encode])
public <String> toString ( )

public void appendQS (obj)

Append the given parameters to a query string of the URI.


Parameters:
  • obj <Object>

    a dictionary of parameters to be appended to the URL query string

public <zebkit.URI> getParent ( )

Get a parent URI.


Returns: <zebkit.URI>

a parent URI.

public <Boolean> isAbsolute ( )

Test if the URI is absolute.


Returns: <Boolean>

true if the URI is absolute.

public static <Boolean> isAbsolute (u)

Test if the given string is absolute path or URI.


Parameters:
Returns: <Boolean>

true if the string is absolute path or URI.

public <Boolean> isFilePath ( )

Test if the given URL is file path.


Returns: <Boolean>

true if the URL is file path

public static <Boolean> isURL (u)

Test if the given string is URL.


Parameters:
Returns: <Boolean>

true if the string is URL

public static <String> join (p)

Join the given paths


Parameters:
Returns: <String>

a joined path as string

public <String> join (p)

Join URI with the specified path


Parameters:
  • p <String> (*..n)

    relative paths


Returns: <String>

an absolute URI

public static <Object> parseQS (url, [decode])

Parse the specified query string of the given URI.


Parameters:
Returns: <Object>

a parsed query string as a dictionary of parameters

public static <String> relative (base, path)

Get a relative path.


Parameters:
Returns: <String>

a relative path

public <String> relative (to)

Get an URI relative to the given URI.


Parameters:
Returns: <String>

a relative URI

public static <String> toQS (obj, [encode])

Convert the given dictionary of parameters to a query string.


Parameters:
  • obj <Object>

    a dictionary of parameters

  • [encode] <Boolean>

    pass true if the parameters values have to be encoded


Returns: <String>

a query string built from parameters list

public <String> toString ( )

Serialize URI to its string representation.


Returns: <String>

an URI as a string.


public <String> host

URI host.

public <String> path

URI path.

public <Integer> port

URI port number.

public <String> qs

URI query string.

public <String> scheme

URI scheme (e.g. 'http', 'ftp', etc).