URI.java 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434
  1. /* URI.java - An URI class
  2. Copyright (C) 2002 Free Software Foundation, Inc.
  3. This file is part of GNU Classpath.
  4. GNU Classpath is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 2, or (at your option)
  7. any later version.
  8. GNU Classpath is distributed in the hope that it will be useful, but
  9. WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with GNU Classpath; see the file COPYING. If not, write to the
  14. Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  15. 02111-1307 USA.
  16. Linking this library statically or dynamically with other modules is
  17. making a combined work based on this library. Thus, the terms and
  18. conditions of the GNU General Public License cover the whole
  19. combination.
  20. As a special exception, the copyright holders of this library give you
  21. permission to link this library with independent modules to produce an
  22. executable, regardless of the license terms of these independent
  23. modules, and to copy and distribute the resulting executable under
  24. terms of your choice, provided that you also meet, for each linked
  25. independent module, the terms and conditions of the license of that
  26. module. An independent module is a module which is not derived from
  27. or based on this library. If you modify this library, you may extend
  28. this exception to your version of the library, but you are not
  29. obligated to do so. If you do not wish to do so, delete this
  30. exception statement from your version. */
  31. package java.net;
  32. import java.io.IOException;
  33. import java.io.ObjectInputStream;
  34. import java.io.ObjectOutputStream;
  35. import java.io.Serializable;
  36. /**
  37. * @author Michael Koch <konqueror@gmx.de>
  38. * @since 1.4
  39. */
  40. public final class URI
  41. implements Comparable, Serializable
  42. {
  43. static final long serialVersionUID = -6052424284110960213L;
  44. String string;
  45. private String scheme;
  46. private String schemeSpecificPart;
  47. private String authority;
  48. private String userInfo;
  49. private String host;
  50. private int port;
  51. private String path;
  52. private String query;
  53. private String fragment;
  54. private void readObject (ObjectInputStream is)
  55. throws ClassNotFoundException, IOException
  56. {
  57. }
  58. private void writeObject (ObjectOutputStream is)
  59. throws IOException
  60. {
  61. }
  62. private void parseURI (String str)
  63. throws URISyntaxException
  64. {
  65. }
  66. /**
  67. * Creates an URI from the given string
  68. *
  69. * @param str The string to create the URI from
  70. *
  71. * @exception URISyntaxException If the given string violates RFC 2396
  72. * @exception NullPointerException If str is null
  73. */
  74. public URI (String str)
  75. throws URISyntaxException
  76. {
  77. }
  78. /**
  79. * Create an URI from the given components
  80. *
  81. * @param scheme The scheme name
  82. * @param userInfo The username and authorization info
  83. * @param host The hostname
  84. * @param port The port number
  85. * @param path The path
  86. * @param query The query
  87. * @param fragment The fragment
  88. *
  89. * @exception URISyntaxException If the given string violates RFC 2396
  90. */
  91. public URI (String scheme, String userInfo, String host, int port,
  92. String path, String query, String fragment)
  93. throws URISyntaxException
  94. {
  95. }
  96. /**
  97. * Create an URI from the given components
  98. *
  99. * @param scheme The scheme name
  100. * @param authority The authority
  101. * @param path The apth
  102. * @param query The query
  103. * @param fragment The fragmen
  104. *
  105. * @exception URISyntaxException If the given string violates RFC 2396
  106. */
  107. public URI (String scheme, String authority, String path, String query,
  108. String fragment)
  109. throws URISyntaxException
  110. {
  111. }
  112. /**
  113. * Create an URI from the given components
  114. *
  115. * @param scheme The scheme name
  116. * @param host The hostname
  117. * @param path The path
  118. * @param fragment The fragment
  119. *
  120. * @exception URISyntaxException If the given string violates RFC 2396
  121. */
  122. public URI (String scheme, String host, String path, String fragment)
  123. throws URISyntaxException
  124. {
  125. }
  126. /**
  127. * Create an URI from the given components
  128. *
  129. * @param scheme The scheme name
  130. * @param ssp The scheme specific part
  131. * @param fragment The fragment
  132. *
  133. * @exception URISyntaxException If the given string violates RFC 2396
  134. */
  135. public URI (String scheme, String ssp, String fragment)
  136. throws URISyntaxException
  137. {
  138. }
  139. /**
  140. * Create an URI from the given string
  141. *
  142. * @param str The string to create the URI from
  143. *
  144. * @exception IllegalArgumentException If the given string violates RFC 2396
  145. * @exception NullPointerException If str is null
  146. */
  147. public static URI create (String str)
  148. throws IllegalArgumentException, URISyntaxException
  149. {
  150. return null;
  151. }
  152. /**
  153. * Attempts to parse this URI's authority component, if defined,
  154. * into user-information, host, and port components
  155. *
  156. * @exception URISyntaxException If the given string violates RFC 2396
  157. */
  158. public URI parseServerAuthority ()
  159. throws URISyntaxException
  160. {
  161. return null;
  162. }
  163. /**
  164. * Returns a normalizes versions of the URI
  165. */
  166. public URI normalize ()
  167. {
  168. return null;
  169. }
  170. /**
  171. * Resolves the given URI against this URI
  172. *
  173. * @param uri The URI to resolve against this URI
  174. *
  175. * @return The resulting URI
  176. *
  177. * @exception NullPointerException If uri is null
  178. */
  179. public URI resolve (URI uri)
  180. {
  181. return null;
  182. }
  183. /**
  184. * Resolves the given URI string against this URI
  185. *
  186. * @param str The URI as string to resolve against this URI
  187. *
  188. * @return The resulting URI
  189. *
  190. * @exception IllegalArgumentException If the given URI string
  191. * violates RFC 2396
  192. * @exception NullPointerException If uri is null
  193. */
  194. public URI resolve (String str)
  195. throws IllegalArgumentException
  196. {
  197. return null;
  198. }
  199. /**
  200. * Relativizes the given URI against this URI
  201. *
  202. * @param uri The URI to relativize this URI
  203. *
  204. * @return The resulting URI
  205. *
  206. * @exception NullPointerException If uri is null
  207. */
  208. public URI relativize (URI uri)
  209. {
  210. return null;
  211. }
  212. /**
  213. * Creates an URL from an URI
  214. *
  215. * @exception MalformedURLException If a protocol handler for the URL could
  216. * not be found, or if some other error occurred while constructing the URL
  217. * @exception IllegalArgumentException If the URI is not absolute
  218. */
  219. public URL toURL ()
  220. throws IllegalArgumentException, MalformedURLException
  221. {
  222. return null;
  223. }
  224. /**
  225. * Returns the scheme of the URI
  226. */
  227. public String getScheme ()
  228. {
  229. return scheme;
  230. }
  231. /**
  232. * Tells whether this URI is absolute or not
  233. */
  234. public boolean isAbsolute ()
  235. {
  236. return false;
  237. }
  238. /**
  239. * Tell whether this URI is opaque or not
  240. */
  241. public boolean isOpaque ()
  242. {
  243. return false;
  244. }
  245. /**
  246. * Returns the raw scheme specific part of this URI.
  247. * The scheme-specific part is never undefined, though it may be empty
  248. */
  249. public String getRawSchemeSpecificPart ()
  250. {
  251. return null;
  252. }
  253. /**
  254. * Returns the decoded scheme specific part of this URI.
  255. */
  256. public String getSchemeSpecificPart ()
  257. {
  258. return null;
  259. }
  260. /**
  261. * Returns the rae authority part of this URI
  262. */
  263. public String getRawAuthority ()
  264. {
  265. return authority;
  266. }
  267. /**
  268. * Returns the decoded authority part of this URI
  269. */
  270. public String getAuthority ()
  271. {
  272. return null;
  273. }
  274. /**
  275. * Returns the raw user info part of this URI
  276. */
  277. public String getRawUserInfo ()
  278. {
  279. return userInfo;
  280. }
  281. /**
  282. * Returns the decoded user info part of this URI
  283. */
  284. public String getUserInfo ()
  285. {
  286. return null;
  287. }
  288. /**
  289. * Returns the hostname of the URI
  290. */
  291. public String getHost ()
  292. {
  293. return host;
  294. }
  295. /**
  296. * Returns the port number of the URI
  297. */
  298. public int getPort ()
  299. {
  300. return port;
  301. }
  302. /**
  303. * Returns the raw path part of this URI
  304. */
  305. public String getRawPath ()
  306. {
  307. return path;
  308. }
  309. /**
  310. * Returns the path of the URI
  311. */
  312. public String getPath ()
  313. {
  314. return null;
  315. }
  316. /**
  317. * Returns the raw query part of this URI
  318. */
  319. public String getRawQuery ()
  320. {
  321. return query;
  322. }
  323. /**
  324. * Returns the query of the URI
  325. */
  326. public String getQuery ()
  327. {
  328. return null;
  329. }
  330. /**
  331. * Return the raw fragment part of this URI
  332. */
  333. public String getRawFragment ()
  334. {
  335. return fragment;
  336. }
  337. /**
  338. * Returns the fragment of the URI
  339. */
  340. public String getFragment ()
  341. {
  342. return null;
  343. }
  344. /**
  345. * Compares the URI with a given object
  346. *
  347. * @param obj The obj to compare the URI with
  348. */
  349. public boolean equals(Object obj)
  350. {
  351. return false;
  352. }
  353. /**
  354. * Computes the hascode of the URI
  355. */
  356. public int hashCode ()
  357. {
  358. return 0;
  359. }
  360. /**
  361. * Compare the URI with another object that must be an URI too
  362. *
  363. * @param obj This object to compare this URI with
  364. *
  365. * @exception ClassCastException If given object ist not an URI
  366. */
  367. public int compareTo (Object obj)
  368. throws ClassCastException
  369. {
  370. return 0;
  371. }
  372. /**
  373. * Returns the URI as string
  374. */
  375. public String toString ()
  376. {
  377. return "";
  378. }
  379. /**
  380. * Returns the URI as US-ASCII string
  381. */
  382. public String toASCIIString ()
  383. {
  384. return "";
  385. }
  386. }