Java Doc for URLCodec.java in  » Library » Apache-common-codec » org » apache » commons » codec » net » 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 » Library » Apache common codec » org.apache.commons.codec.net 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.commons.codec.net.URLCodec

URLCodec
public class URLCodec implements BinaryEncoder,BinaryDecoder,StringEncoder,StringDecoder(Code)

Implements the 'www-form-urlencoded' encoding scheme, also misleadingly known as URL encoding.

For more detailed information please refer to Chapter 17.13.4 'Form content types' of the HTML 4.01 Specification

This codec is meant to be a replacement for standard Java classes java.net.URLEncoder and java.net.URLDecoder on older Java platforms, as these classes in Java versions below 1.4 rely on the platform's default charset encoding.


author:
   Apache Software Foundation
since:
   1.2
version:
   $Id: URLCodec.java,v 1.19 2004/03/29 07:59:00 ggregory Exp $


Field Summary
protected static  byteESCAPE_CHAR
    
final protected static  BitSetWWW_FORM_URL
     BitSet of www-form-url safe characters.
protected  Stringcharset
     The default charset used for string decoding and encoding.

Constructor Summary
public  URLCodec()
     Default constructor.
public  URLCodec(String charset)
    

Method Summary
public  byte[]decode(byte[] bytes)
     Decodes an array of URL safe 7-bit characters into an array of original bytes.
public  Stringdecode(String pString, String charset)
     Decodes a URL safe string into its original form using the specified encoding.
public  Stringdecode(String pString)
     Decodes a URL safe string into its original form using the default string charset.
public  Objectdecode(Object pObject)
     Decodes a URL safe object into its original form.
final public static  byte[]decodeUrl(byte[] bytes)
     Decodes an array of URL safe 7-bit characters into an array of original bytes.
public  byte[]encode(byte[] bytes)
     Encodes an array of bytes into an array of URL safe 7-bit characters.
public  Stringencode(String pString, String charset)
     Encodes a string into its URL safe form using the specified string charset.
public  Stringencode(String pString)
     Encodes a string into its URL safe form using the default string charset.
public  Objectencode(Object pObject)
     Encodes an object into its URL safe form.
final public static  byte[]encodeUrl(BitSet urlsafe, byte[] bytes)
     Encodes an array of bytes into an array of URL safe 7-bit characters.
public  StringgetDefaultCharset()
     The default charset used for string decoding and encoding.
public  StringgetEncoding()
     The String encoding used for decoding and encoding.

Field Detail
ESCAPE_CHAR
protected static byte ESCAPE_CHAR(Code)



WWW_FORM_URL
final protected static BitSet WWW_FORM_URL(Code)
BitSet of www-form-url safe characters.



charset
protected String charset(Code)
The default charset used for string decoding and encoding.




Constructor Detail
URLCodec
public URLCodec()(Code)
Default constructor.



URLCodec
public URLCodec(String charset)(Code)
Constructor which allows for the selection of a default charset
Parameters:
  charset - the default string charset to use.




Method Detail
decode
public byte[] decode(byte[] bytes) throws DecoderException(Code)
Decodes an array of URL safe 7-bit characters into an array of original bytes. Escaped characters are converted back to their original representation.
Parameters:
  bytes - array of URL safe characters array of original bytes
throws:
  DecoderException - Thrown if URL decoding is unsuccessful



decode
public String decode(String pString, String charset) throws DecoderException, UnsupportedEncodingException(Code)
Decodes a URL safe string into its original form using the specified encoding. Escaped characters are converted back to their original representation.
Parameters:
  pString - URL safe string to convert into its original form
Parameters:
  charset - the original string charset original string
throws:
  DecoderException - Thrown if URL decoding is unsuccessful
throws:
  UnsupportedEncodingException - Thrown if charset is notsupported



decode
public String decode(String pString) throws DecoderException(Code)
Decodes a URL safe string into its original form using the default string charset. Escaped characters are converted back to their original representation.
Parameters:
  pString - URL safe string to convert into its original form original string
throws:
  DecoderException - Thrown if URL decoding is unsuccessful
See Also:   URLCodec.getDefaultCharset()



decode
public Object decode(Object pObject) throws DecoderException(Code)
Decodes a URL safe object into its original form. Escaped characters are converted back to their original representation.
Parameters:
  pObject - URL safe object to convert into its original form original object
throws:
  DecoderException - Thrown if URL decoding is not applicable to objects of this typeif decoding is unsuccessful



decodeUrl
final public static byte[] decodeUrl(byte[] bytes) throws DecoderException(Code)
Decodes an array of URL safe 7-bit characters into an array of original bytes. Escaped characters are converted back to their original representation.
Parameters:
  bytes - array of URL safe characters array of original bytes
throws:
  DecoderException - Thrown if URL decoding is unsuccessful



encode
public byte[] encode(byte[] bytes)(Code)
Encodes an array of bytes into an array of URL safe 7-bit characters. Unsafe characters are escaped.
Parameters:
  bytes - array of bytes to convert to URL safe characters array of bytes containing URL safe characters



encode
public String encode(String pString, String charset) throws UnsupportedEncodingException(Code)
Encodes a string into its URL safe form using the specified string charset. Unsafe characters are escaped.
Parameters:
  pString - string to convert to a URL safe form
Parameters:
  charset - the charset for pString URL safe string
throws:
  UnsupportedEncodingException - Thrown if charset is notsupported



encode
public String encode(String pString) throws EncoderException(Code)
Encodes a string into its URL safe form using the default string charset. Unsafe characters are escaped.
Parameters:
  pString - string to convert to a URL safe form URL safe string
throws:
  EncoderException - Thrown if URL encoding is unsuccessful
See Also:   URLCodec.getDefaultCharset()



encode
public Object encode(Object pObject) throws EncoderException(Code)
Encodes an object into its URL safe form. Unsafe characters are escaped.
Parameters:
  pObject - string to convert to a URL safe form URL safe object
throws:
  EncoderException - Thrown if URL encoding is not applicable to objects of this type orif encoding is unsuccessful



encodeUrl
final public static byte[] encodeUrl(BitSet urlsafe, byte[] bytes)(Code)
Encodes an array of bytes into an array of URL safe 7-bit characters. Unsafe characters are escaped.
Parameters:
  urlsafe - bitset of characters deemed URL safe
Parameters:
  bytes - array of bytes to convert to URL safe characters array of bytes containing URL safe characters



getDefaultCharset
public String getDefaultCharset()(Code)
The default charset used for string decoding and encoding. the default string charset.



getEncoding
public String getEncoding()(Code)
The String encoding used for decoding and encoding. Returns the encoding.



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.