Krótka ściągawka pokazuje, co dokładnie jest zwracane przez daną metodę. A tutaj jest skrypt, który automagicznie utworzył poniższe tabelki ;)
new java.net.URI("http://jamlasica.jogger.pl")
| Method |
Result |
getScheme() |
http |
getUserInfo() |
null |
getHost() |
jamlasica.jogger.pl |
getPort() |
-1 |
getPath() |
"" (empty String) |
getQuery() |
null |
getFragment() |
null |
toString() |
http://jamlasica.jogger.pl |
toASCIIString() |
http://jamlasica.jogger.pl |
toURL() |
http://jamlasica.jogger.pl |
getAuthority() |
jamlasica.jogger.pl |
getRawAuthority() |
jamlasica.jogger.pl |
getRawUserInfo() |
null |
getRawPath() |
"" (empty String) |
getRawQuery() |
null |
getRawFragment() |
null |
getSchemeSpecificPart() |
//jamlasica.jogger.pl |
getRawSchemeSpecificPart() |
//jamlasica.jogger.pl |
new java.net.URI("http://www.google.pl/search?q=mały%20żółw")
| Method |
Result |
getScheme() |
http |
getUserInfo() |
null |
getHost() |
www.google.pl |
getPort() |
-1 |
getPath() |
/search |
getQuery() |
q=mały żółw |
getFragment() |
null |
toString() |
http://www.google.pl/search?q=mały%20żółw |
toASCIIString() |
http://www.google.pl/search?q=ma%C5%82y%20%C5%BC%C3%B3%C5%82w |
toURL() |
http://www.google.pl/search?q=mały%20żółw |
getAuthority() |
www.google.pl |
getRawAuthority() |
www.google.pl |
getRawUserInfo() |
null |
getRawPath() |
/search |
getRawQuery() |
q=mały%20żółw |
getRawFragment() |
null |
getSchemeSpecificPart() |
//www.google.pl/search?q=mały żółw |
getRawSchemeSpecificPart() |
//www.google.pl/search?q=mały%20żółw |
new java.net.URI("mailto:kowalski@example.com.pl?subject=Tytuł&body=Hi")
| Method |
Result |
getScheme() |
mailto |
getUserInfo() |
null |
getHost() |
null |
getPort() |
-1 |
getPath() |
null |
getQuery() |
null |
getFragment() |
null |
toString() |
mailto:kowalski@example.com.pl?subject=Tytuł&body=Hi |
toASCIIString() |
mailto:kowalski@example.com.pl?subject=Tytu%C5%82&body=Hi |
toURL() |
mailto:kowalski@example.com.pl?subject=Tytuł&body=Hi |
getAuthority() |
null |
getRawAuthority() |
null |
getRawUserInfo() |
null |
getRawPath() |
null |
getRawQuery() |
null |
getRawFragment() |
null |
getSchemeSpecificPart() |
kowalski@example.com.pl?subject=Tytuł&body=Hi |
getRawSchemeSpecificPart() |
kowalski@example.com.pl?subject=Tytuł&body=Hi |
new java.net.URI("http://user%20foo:password@example.com:666/this%20is%20a%20path?query%20test=żółw#documentFragment")
| Method |
Result |
getScheme() |
http |
getUserInfo() |
user foo:password |
getHost() |
example.com |
getPort() |
666 |
getPath() |
/this is a path |
getQuery() |
query test=żółw |
getFragment() |
documentFragment |
toString() |
http://user%20foo:password@example.com:666/this%20is%20a%20path?query%20test=żółw#documentFragment |
toASCIIString() |
http://user%20foo:password@example.com:666/this%20is%20a%20path?query%20test=%C5%BC%C3%B3%C5%82w#documentFragment |
toURL() |
http://user%20foo:password@example.com:666/this%20is%20a%20path?query%20test=żółw#documentFragment |
getAuthority() |
user foo:password@example.com:666 |
getRawAuthority() |
user%20foo:password@example.com:666 |
getRawUserInfo() |
user%20foo:password |
getRawPath() |
/this%20is%20a%20path |
getRawQuery() |
query%20test=żółw |
getRawFragment() |
documentFragment |
getSchemeSpecificPart() |
//user foo:password@example.com:666/this is a path?query test=żółw |
getRawSchemeSpecificPart() |
//user%20foo:password@example.com:666/this%20is%20a%20path?query%20test=żółw |