Java Doc for CGIParser.java in  » Template-Engine » ostermillerutils » com » Ostermiller » 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 » Template Engine » ostermillerutils » com.Ostermiller.util 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.Ostermiller.util.CGIParser

CGIParser
public class CGIParser (Code)
Parses query string data from a CGI request into name value pairs.

More information about this class is available from ostermiller.org.
author:
   Stephen Ostermiller http://ostermiller.org/contact.pl?regarding=Java+Utilities
since:
   ostermillerutils 1.00.00




Constructor Summary
public  CGIParser(InputStream in)
     Extract the name, value pairs from the given input stream and make them available for retrieval.
public  CGIParser(InputStream in, String charset)
     Extract the name, value pairs from the given input stream and make them available for retrieval.
public  CGIParser(Reader in)
     Extract the name, value pairs from the given reader and make them available for retrieval.
public  CGIParser(Reader in, String charset)
     Extract the name, value pairs from the given reader and make them available for retrieval.
public  CGIParser(String s)
     Extract the name, value pairs from the given string and make them available for retrieval.
public  CGIParser(String s, String charset)
     Extract the name, value pairs from the given string and make them available for retrieval.

Method Summary
public  voidaddParameter(String name, String value)
     Set a name value pair as used in a URL. This method will add to any previously defined values the values specified.
public  voidaddParameter(String name, String[] values)
     Set a name value pair as used in a URL. This method will add to any previously defined values the values specified.
public  StringgetParameter(String name)
     Returns the value of a request parameter as a String, or null if the parameter does not exist.
public  String[]getParameterNameList()
     Returns the names of the parameters contained in this request.
public  Enumeration<String>getParameterNames()
     Returns an Enumeration of String objects containing the names of the parameters contained in this request.
public  String[]getParameterValues(String name)
     Returns an array of String objects containing all of the values the given request parameter has, or null if the parameter does not exist.
public  NameValuePair[]getParameters()
     Get the all the parameters in the order in which they were added.
public  voidsetParameter(String name, String value)
     Set a name value pair as used in a URL. This method will replace any previously defined values with the single value specified.
public  voidsetParameter(String name, String[] values)
     Set a name value pair as used in a URL. This method will replace any previously defined values with the single value specified.
public  StringtoString(String enc)
     Returns the name value pairs properly escaped and written in URL format.
Parameters:
  enc - Character encoding to use when escaping characters.
public  StringtoString()
     Returns the name value pairs properly escaped and written in URL format with UTF-8 URL encoding.


Constructor Detail
CGIParser
public CGIParser(InputStream in) throws IOException(Code)
Extract the name, value pairs from the given input stream and make them available for retrieval.

The stream is read until the stream contains no more bytes.

Byte to character conversion on the stream is done according the platforms default character encoding.
Parameters:
  in - Stream containing CGI Encoded name value pairs.
throws:
  IOException - If an input error occurs
since:
   ostermillerutils 1.00.00




CGIParser
public CGIParser(InputStream in, String charset) throws IOException, UnsupportedEncodingException(Code)
Extract the name, value pairs from the given input stream and make them available for retrieval.

The stream is read until the stream contains no more bytes.

The character set is used both when converting the byte stream to a character stream and when decoding URL decoded parameters.
Parameters:
  in - Stream containing CGI Encoded name value pairs.
Parameters:
  charset - Character encoding to use when converting bytes to characters
throws:
  IOException - If an input error occurs
throws:
  UnsupportedEncodingException - If the character set provided is not recognized
since:
   ostermillerutils 1.03.00




CGIParser
public CGIParser(Reader in) throws IOException(Code)
Extract the name, value pairs from the given reader and make them available for retrieval.

The reader is read until the stream contains no more characters.
Parameters:
  in - Reader containing CGI Encoded name value pairs.
throws:
  IOException - If an input error occurs
since:
   ostermillerutils 1.00.00




CGIParser
public CGIParser(Reader in, String charset) throws IOException, UnsupportedEncodingException(Code)
Extract the name, value pairs from the given reader and make them available for retrieval.

The reader is read until the stream contains no more characters.
Parameters:
  in - Reader containing CGI Encoded name value pairs.
Parameters:
  charset - Character encoding to use when converting bytes to characters
throws:
  IOException - If an input error occurs
throws:
  UnsupportedEncodingException - If the character set provided is not recognized
since:
   ostermillerutils 1.03.00




CGIParser
public CGIParser(String s)(Code)
Extract the name, value pairs from the given string and make them available for retrieval.
Parameters:
  s - CGI Encoded name value pairs.
since:
   ostermillerutils 1.00.00



CGIParser
public CGIParser(String s, String charset) throws UnsupportedEncodingException(Code)
Extract the name, value pairs from the given string and make them available for retrieval.
Parameters:
  s - CGI Encoded name value pairs.
Parameters:
  charset - Character encoding to use when converting bytes to characters
throws:
  UnsupportedEncodingException - If the character set provided is not recognized
since:
   ostermillerutils 1.03.00




Method Detail
addParameter
public void addParameter(String name, String value)(Code)
Set a name value pair as used in a URL. This method will add to any previously defined values the values specified. If value is null, this method has no effect.
Parameters:
  name - a String specifying the name of the parameter.
Parameters:
  value - a String specifying the value of the single parameter, or null to remove.
since:
   ostermillerutils 1.02.15



addParameter
public void addParameter(String name, String[] values)(Code)
Set a name value pair as used in a URL. This method will add to any previously defined values the values specified. If values is null, this method has no effect.
Parameters:
  name - a String specifying the name of the parameter.
Parameters:
  values - a String array specifying the values of the parameter, or null to remove.
throws:
  NullPointerException - if any of the values is null.
since:
   ostermillerutils 1.02.15



getParameter
public String getParameter(String name)(Code)
Returns the value of a request parameter as a String, or null if the parameter does not exist. Request parameters are extra information sent with the request.

You should only use this method when you are sure the parameter has only one value. If the parameter might have more than one value, use getParameterValues(java.lang.String).

If you use this method with a multiple valued parameter, the value returned is equal to the first value in the array returned by getParameterValues.
Parameters:
  name - a String specifying the name of the parameter a String representing the single value of the parameter
since:
   ostermillerutils 1.00.00




getParameterNameList
public String[] getParameterNameList()(Code)
Returns the names of the parameters contained in this request. If the request has no parameters, the method returns an empty String array. Each name will appear only once, even if it was contained in the request multiple times. The order of the names may not match the order from the request. An array of Strings, each of which is the nameof a request parameter; or an array of length zero if the request hasno parameters
since:
   ostermillerutils 1.03.00



getParameterNames
public Enumeration<String> getParameterNames()(Code)
Returns an Enumeration of String objects containing the names of the parameters contained in this request. If the request has no parameters, the method returns an empty Enumeration. an Enumeration of String objects, each String containing the nameof a request parameter; or an empty Enumeration if the request hasno parameters
since:
   ostermillerutils 1.00.00



getParameterValues
public String[] getParameterValues(String name)(Code)
Returns an array of String objects containing all of the values the given request parameter has, or null if the parameter does not exist.

If the parameter has a single value, the array has a length of 1.
Parameters:
  name - a String containing the name of the parameter whose value is requested an array of String objects containing the parameter's values
since:
   ostermillerutils 1.00.00




getParameters
public NameValuePair[] getParameters()(Code)
Get the all the parameters in the order in which they were added. array of all name value pairs.



setParameter
public void setParameter(String name, String value)(Code)
Set a name value pair as used in a URL. This method will replace any previously defined values with the single value specified. If the value is null, the name is removed.
Parameters:
  name - a String specifying the name of the parameter.
Parameters:
  value - a String specifying the value of the single parameter, or null to remove.
since:
   ostermillerutils 1.02.15



setParameter
public void setParameter(String name, String[] values)(Code)
Set a name value pair as used in a URL. This method will replace any previously defined values with the single value specified. If values is null or empty, the name is removed.
Parameters:
  name - a String specifying the name of the parameter.
Parameters:
  values - a String array specifying the values for the parameter, or null to remove.
throws:
  NullPointerException - if any of the values is null.
since:
   ostermillerutils 1.02.15



toString
public String toString(String enc) throws UnsupportedEncodingException(Code)
Returns the name value pairs properly escaped and written in URL format.
Parameters:
  enc - Character encoding to use when escaping characters. URLEncoded name value pairs.
throws:
  UnsupportedEncodingException - If the named encoding is not supported.
since:
   ostermillerutils 1.00.00



toString
public String toString()(Code)
Returns the name value pairs properly escaped and written in URL format with UTF-8 URL encoding. URLEncoded name value pairs.
since:
   ostermillerutils 1.03.00



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.