Package totalcross.net
Class URI
- java.lang.Object
-
- totalcross.net.URI
-
public class URI extends java.lang.ObjectAn URI represents a Uniform Resource Identifier, or an address of something in the Internet.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classURI.PathUsed as the path component of this URI.
-
Field Summary
Fields Modifier and Type Field Description ByteStringauthorityThe authority represented in this URI.ByteStringfragmentThe fragment stored in this URI.ByteStringhostThe host represented in this URI.URI.PathpathThe path represented in this URI.intportThe port stored in this URI.ByteStringqueryThe query stored in this URI.ByteStringschemeThe scheme represented in this URI.ByteStringuserInfoThe user information represented in this URI.
-
Constructor Summary
Constructors Constructor Description URI(byte[] spec, int start, int len)Constructor from a byte array.URI(byte[] spec, int start, int len, URI baseURI)Constructor from a byte array, and a base URI missing components derive from.URI(java.lang.String spec)Constructor from a StringURI(java.lang.String spec, URI baseURI)Constructor from a String and a base URI
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.lang.Stringdecode(java.lang.String val)Decodes aapplication/x-www-form-urlencodedstringstatic voiddecode(java.lang.String val, java.lang.StringBuffer sb)Decodes aapplication/x-www-form-urlencodedstringstatic java.lang.Stringencode(java.lang.String val)Encodes to aapplication/x-www-form-urlencodedstatic voidencode(java.lang.String val, java.lang.StringBuffer sb)Encodes to aapplication/x-www-form-urlencodedjava.lang.StringtoString()Return a String representation of this URI
-
-
-
Field Detail
-
scheme
public ByteString scheme
The scheme represented in this URI.
-
authority
public ByteString authority
The authority represented in this URI.
-
userInfo
public ByteString userInfo
The user information represented in this URI.
-
host
public ByteString host
The host represented in this URI.
-
path
public URI.Path path
The path represented in this URI.
-
query
public ByteString query
The query stored in this URI.
-
fragment
public ByteString fragment
The fragment stored in this URI.
-
port
public int port
The port stored in this URI.
-
-
Constructor Detail
-
URI
public URI(java.lang.String spec)
Constructor from a String- Parameters:
spec- String that holds the specified URI
-
URI
public URI(java.lang.String spec, URI baseURI)Constructor from a String and a base URI- Parameters:
spec- String that holds the specified URIbaseURI- base URI for deriving relative components
-
URI
public URI(byte[] spec, int start, int len)Constructor from a byte array.- Parameters:
spec- byte array that holds the specified URIstart- where the URI starts in the byte arraylen- length of the URI
-
URI
public URI(byte[] spec, int start, int len, URI baseURI)Constructor from a byte array, and a base URI missing components derive from.- Parameters:
spec- byte array that holds the specified URIstart- where the URI starts in the byte arraylen- length of the URIbaseURI- base URI for deriving relative components
-
-
Method Detail
-
toString
public java.lang.String toString()
Return a String representation of this URI- Overrides:
toStringin classjava.lang.Object- Returns:
- a String representation of this URI
-
encode
public static java.lang.String encode(java.lang.String val)
Encodes to aapplication/x-www-form-urlencoded- Parameters:
val- the String to encode- Returns:
- the encoded String.
-
decode
public static java.lang.String decode(java.lang.String val)
Decodes aapplication/x-www-form-urlencodedstring- Parameters:
val- the String to decode- Returns:
- the decoded String.
-
encode
public static void encode(java.lang.String val, java.lang.StringBuffer sb)Encodes to aapplication/x-www-form-urlencoded- Parameters:
val- the String to encodesb- the StringBuffer where to write the encoded form
-
decode
public static void decode(java.lang.String val, java.lang.StringBuffer sb)Decodes aapplication/x-www-form-urlencodedstring- Parameters:
val- the String to decodesb- the StringBuffer where to write the decoded form
-
-