Java Doc for URI.java in  » Net » SkunkDAV » HTTPClient » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Net » SkunkDAV » HTTPClient 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   HTTPClient.URI

URI
public class URI (Code)
This class represents a generic URI, as defined in RFC-2396. This is similar to java.net.URL, with the following enhancements:
  • it doesn't require a URLStreamhandler to exist for the scheme; this allows this class to be used to hold any URI, construct absolute URIs from relative ones, etc.
  • it handles escapes correctly
  • equals() works correctly
  • relative URIs are correctly constructed
  • it has methods for accessing various fields such as userinfo, fragment, params, etc.
  • it handles less common forms of resources such as the "*" used in http URLs.

Ideally, java.net.URL should subclass URI.
See Also:    rfc-2396
version:
   0.3-2 18/06/1999
author:
   Ronald Tschalär
since:
   V0.3-1



Field Summary
protected static  BitSetalphanumChar
    
protected  Stringfragment
    
protected  Stringhost
    
protected  booleanis_generic
    
protected static  BitSetmarkChar
    
protected  Stringopaque
    
protected  Stringpath
    
protected static  BitSetpcharChar
    
protected  intport
    
protected  Stringquery
    
protected static  BitSetreg_nameChar
    
protected static  BitSetreservedChar
    
protected  Stringscheme
    
protected static  BitSetschemeChar
    
protected static  BitSetunreservedChar
    
protected static  BitSeturicChar
    
protected  URLurl
    
protected  Stringuserinfo
    
protected static  BitSetuserinfoChar
    

Constructor Summary
public  URI(String uri)
     Constructs a URI from the given string representation.
public  URI(URI base, String rel_uri)
     Constructs a URI from the given string representation, relative to the given base URI.
public  URI(URL url)
     Construct a URI from the given URL.
public  URI(String scheme, String host, String path)
     Constructs a URI from the given parts, using the default port for this scheme (if known).
public  URI(String scheme, String host, int port, String path)
     Constructs a URI from the given parts.
public  URI(String scheme, String userinfo, String host, int port, String path, String query, String fragment)
     Constructs a URI from the given parts.
public  URI(String scheme, String opaque)
     Constructs an opaque URI from the given parts.

Method Summary
final public static  intdefaultPort(String protocol)
     Return the default port used by a given protocol.
public  booleanequals(Object other)
    
public  StringgetFragment()
    
public  StringgetHost()
    
public  StringgetOpaque()
    
public  StringgetPath()
    
public  intgetPort()
    
public  StringgetQueryString()
    
public  StringgetScheme()
    
public  StringgetUserinfo()
    
public  booleanisGenericURI()
     Does the scheme specific part of this URI use the generic-URI syntax?

In general URI are split into two categories: opaque-URI and generic-URI.

public static  voidmain(String args)
     Run test set.
public  StringtoExternalForm()
    
public  StringtoString()
    
public  URLtoURL()
     Will try to create a java.net.URL object from this URI.
final static  Stringunescape(String str)
     Unescape escaped characters (i.e.
public static  booleanusesGenericSyntax(String scheme)
    

Field Detail
alphanumChar
protected static BitSet alphanumChar(Code)



fragment
protected String fragment(Code)



host
protected String host(Code)



is_generic
protected boolean is_generic(Code)



markChar
protected static BitSet markChar(Code)



opaque
protected String opaque(Code)



path
protected String path(Code)



pcharChar
protected static BitSet pcharChar(Code)



port
protected int port(Code)



query
protected String query(Code)



reg_nameChar
protected static BitSet reg_nameChar(Code)



reservedChar
protected static BitSet reservedChar(Code)



scheme
protected String scheme(Code)



schemeChar
protected static BitSet schemeChar(Code)



unreservedChar
protected static BitSet unreservedChar(Code)



uricChar
protected static BitSet uricChar(Code)



url
protected URL url(Code)



userinfo
protected String userinfo(Code)



userinfoChar
protected static BitSet userinfoChar(Code)




Constructor Detail
URI
public URI(String uri) throws ParseException(Code)
Constructs a URI from the given string representation. The string must be an absolute URI.
Parameters:
  uri - a String containing an absolute URI
exception:
  ParseException - if no scheme can be found or a specifiedport cannot be parsed as a number



URI
public URI(URI base, String rel_uri) throws ParseException(Code)
Constructs a URI from the given string representation, relative to the given base URI.
Parameters:
  base - the base URI, relative to which rel_uriis to be parsed
Parameters:
  rel_uri - a String containing a relative or absolute URI
exception:
  ParseException - if base is null andrel_uri is not an absolute URI, orif base is not null and the schemeis not known to use the generic syntax, orif a given port cannot be parsed as a number



URI
public URI(URL url) throws ParseException(Code)
Construct a URI from the given URL.
Parameters:
  url - the URL
exception:
  ParseException - if url.toExternalForm() generatesan invalid string representation



URI
public URI(String scheme, String host, String path) throws ParseException(Code)
Constructs a URI from the given parts, using the default port for this scheme (if known).
Parameters:
  scheme - the scheme (sometimes known as protocol)
Parameters:
  host - the host
Parameters:
  path - the path part
exception:
  ParseException - if scheme is null



URI
public URI(String scheme, String host, int port, String path) throws ParseException(Code)
Constructs a URI from the given parts.
Parameters:
  scheme - the scheme (sometimes known as protocol)
Parameters:
  host - the host
Parameters:
  port - the port
Parameters:
  path - the path part
exception:
  ParseException - if scheme is null



URI
public URI(String scheme, String userinfo, String host, int port, String path, String query, String fragment) throws ParseException(Code)
Constructs a URI from the given parts. Any part except for the the scheme may be null.
Parameters:
  scheme - the scheme (sometimes known as protocol)
Parameters:
  userinfo - the userinfo
Parameters:
  host - the host
Parameters:
  port - the port
Parameters:
  path - the path part
Parameters:
  query - the query string
Parameters:
  fragment - the fragment identifier
exception:
  ParseException - if scheme is null



URI
public URI(String scheme, String opaque) throws ParseException(Code)
Constructs an opaque URI from the given parts.
Parameters:
  scheme - the scheme (sometimes known as protocol)
Parameters:
  opaque - the opaque part
exception:
  ParseException - if scheme is null




Method Detail
defaultPort
final public static int defaultPort(String protocol)(Code)
Return the default port used by a given protocol.
Parameters:
  protocol - the protocol the port number, or 0 if unknown



equals
public boolean equals(Object other)(Code)
true if other is either a URI or URL and itmatches the current URI



getFragment
public String getFragment()(Code)
the fragment



getHost
public String getHost()(Code)
the host



getOpaque
public String getOpaque()(Code)
the opaque part, or null if this URI is generic



getPath
public String getPath()(Code)
the path; this includes the query string



getPort
public int getPort()(Code)
the port, or -1 if it's the default port



getQueryString
public String getQueryString()(Code)
the query string



getScheme
public String getScheme()(Code)
the scheme (often also referred to as protocol)



getUserinfo
public String getUserinfo()(Code)
the user info



isGenericURI
public boolean isGenericURI()(Code)
Does the scheme specific part of this URI use the generic-URI syntax?

In general URI are split into two categories: opaque-URI and generic-URI. The generic-URI syntax is the syntax most are familiar with from URLs such as ftp- and http-URLs, which is roughly:

 generic-URI = scheme ":" [ "//" server ] [ "/" ] [ path_segments ] [ "?" query ]
 
(see draft-fielding-uri-syntax-03 for exact syntax). Only URLs using the generic-URI syntax can be used to create and resolve relative URIs.

Whether a given scheme is parsed according to the generic-URI syntax or wether it is treated as opaque is determined by an internal table of URI schemes.
See Also:    rfc-2396




main
public static void main(String args) throws Exception(Code)
Run test set.
exception:
  Exception - if any test fails



toExternalForm
public String toExternalForm()(Code)
a string representation of this URI suitable for use inlinks, headers, etc.



toString
public String toString()(Code)

See Also:   URI.toExternalForm



toURL
public URL toURL() throws MalformedURLException(Code)
Will try to create a java.net.URL object from this URI. the URL
exception:
  MalformedURLException - if no handler is available for thescheme



unescape
final static String unescape(String str) throws ParseException(Code)
Unescape escaped characters (i.e. %xx).
Parameters:
  str - the string to unescape the unescaped string
exception:
  ParseException - if the two digits following a `%' arenot a valid hex number



usesGenericSyntax
public static boolean usesGenericSyntax(String scheme)(Code)
true if the scheme should be parsed according to thegeneric-URI syntax



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.