Java Doc for URL.java in  » Sevlet-Container » tomcat-catalina » org » apache » catalina » util » 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 » Sevlet Container » tomcat catalina » org.apache.catalina.util 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.catalina.util.URL

URL
final public class URL implements Serializable(Code)

URL is designed to provide public APIs for parsing and synthesizing Uniform Resource Locators as similar as possible to the APIs of java.net.URL, but without the ability to open a stream or connection. One of the consequences of this is that you can construct URLs for protocols for which a URLStreamHandler is not available (such as an "https" URL when JSSE is not installed).

WARNING - This class assumes that the string representation of a URL conforms to the spec argument as described in RFC 2396 "Uniform Resource Identifiers: Generic Syntax":

 <scheme>//<authority><path>?<query>#<fragment>
 

FIXME - This class really ought to end up in a Commons package someplace.


author:
   Craig R. McClanahan
version:
   $Revision: 1.2 $ $Date: 2004/02/27 14:58:51 $



Constructor Summary
public  URL(String spec)
     Create a URL object from the specified String representation.
public  URL(URL context, String spec)
     Create a URL object by parsing a string representation relative to a specified context.
public  URL(String protocol, String host, String file)
     Create a URL object from the specified components.
public  URL(String protocol, String host, int port, String file)
     Create a URL object from the specified components.

Method Summary
public  booleanequals(Object obj)
     Compare two URLs for equality.
public  StringgetAuthority()
     Return the authority part of the URL.
public  StringgetFile()
     Return the filename part of the URL.
public  StringgetHost()
     Return the host name part of the URL.
public  StringgetPath()
     Return the path part of the URL.
public  intgetPort()
     Return the port number part of the URL.
public  StringgetProtocol()
     Return the protocol name part of the URL.
public  StringgetQuery()
     Return the query part of the URL.
public  StringgetRef()
     Return the reference part of the URL.
public  StringgetUserInfo()
     Return the user info part of the URL.
public  voidnormalize()
     Normalize the path (and therefore file) portions of this URL.
public  booleansameFile(URL other)
     Compare two URLs, excluding the "ref" fields.
public  StringtoExternalForm()
     Return a string representation of this URL.
public  StringtoString()
     Return a string representation of this object.


Constructor Detail
URL
public URL(String spec) throws MalformedURLException(Code)
Create a URL object from the specified String representation.
Parameters:
  spec - String representation of the URL
exception:
  MalformedURLException - if the string representationcannot be parsed successfully



URL
public URL(URL context, String spec) throws MalformedURLException(Code)
Create a URL object by parsing a string representation relative to a specified context. Based on logic from JDK 1.3.1's java.net.URL.
Parameters:
  context - URL against which the relative representationis resolved
Parameters:
  spec - String representation of the URL (usually relative)
exception:
  MalformedURLException - if the string representationcannot be parsed successfully



URL
public URL(String protocol, String host, String file) throws MalformedURLException(Code)
Create a URL object from the specified components. The default port number for the specified protocol will be used.
Parameters:
  protocol - Name of the protocol to use
Parameters:
  host - Name of the host addressed by this protocol
Parameters:
  file - Filename on the specified host
exception:
  MalformedURLException - is never thrown, but present forcompatible APIs



URL
public URL(String protocol, String host, int port, String file) throws MalformedURLException(Code)
Create a URL object from the specified components. Specifying a port number of -1 indicates that the URL should use the default port for that protocol. Based on logic from JDK 1.3.1's java.net.URL.
Parameters:
  protocol - Name of the protocol to use
Parameters:
  host - Name of the host addressed by this protocol
Parameters:
  port - Port number, or -1 for the default port for this protocol
Parameters:
  file - Filename on the specified host
exception:
  MalformedURLException - is never thrown, but present forcompatible APIs




Method Detail
equals
public boolean equals(Object obj)(Code)
Compare two URLs for equality. The result is true if and only if the argument is not null, and is a URL object that represents the same URL as this object. Two URLs are equal if they have the same protocol and reference the same host, the same port number on the host, and the same file and anchor on the host.
Parameters:
  obj - The URL to compare against



getAuthority
public String getAuthority()(Code)
Return the authority part of the URL.



getFile
public String getFile()(Code)
Return the filename part of the URL. NOTE - For compatibility with java.net.URL, this value includes the query string if there was one. For just the path portion, call getPath() instead.



getHost
public String getHost()(Code)
Return the host name part of the URL.



getPath
public String getPath()(Code)
Return the path part of the URL.



getPort
public int getPort()(Code)
Return the port number part of the URL.



getProtocol
public String getProtocol()(Code)
Return the protocol name part of the URL.



getQuery
public String getQuery()(Code)
Return the query part of the URL.



getRef
public String getRef()(Code)
Return the reference part of the URL.



getUserInfo
public String getUserInfo()(Code)
Return the user info part of the URL.



normalize
public void normalize() throws MalformedURLException(Code)
Normalize the path (and therefore file) portions of this URL.

NOTE - This method is not part of the public API of java.net.URL, but is provided as a value added service of this implementation.
exception:
  MalformedURLException - if a normalization error occurs,such as trying to move about the hierarchical root




sameFile
public boolean sameFile(URL other)(Code)
Compare two URLs, excluding the "ref" fields. Returns true if this URL and the other argument both refer to the same resource. The two URLs might not both contain the same anchor.



toExternalForm
public String toExternalForm()(Code)
Return a string representation of this URL. This follow the rules in RFC 2396, Section 5.2, Step 7.



toString
public String toString()(Code)
Return a string representation of this object.



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.