|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.hadoop.http.HtmlQuoting
public class HtmlQuoting
This class is responsible for quoting HTML characters.
Constructor Summary | |
---|---|
HtmlQuoting()
|
Method Summary | |
---|---|
static void |
main(String[] args)
|
static boolean |
needsQuoting(byte[] data,
int off,
int len)
Does the given string need to be quoted? |
static boolean |
needsQuoting(String str)
Does the given string need to be quoted? |
static void |
quoteHtmlChars(OutputStream output,
byte[] buffer,
int off,
int len)
Quote all of the active HTML characters in the given string as they are added to the buffer. |
static String |
quoteHtmlChars(String item)
Quote the given item to make it html-safe. |
static OutputStream |
quoteOutputStream(OutputStream out)
Return an output stream that quotes all of the output. |
static String |
unquoteHtmlChars(String item)
Remove HTML quoting from a string. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HtmlQuoting()
Method Detail |
---|
public static boolean needsQuoting(byte[] data, int off, int len)
data
- the string to checkoff
- the starting positionlen
- the number of bytes to check
public static boolean needsQuoting(String str)
str
- the string to check
public static void quoteHtmlChars(OutputStream output, byte[] buffer, int off, int len) throws IOException
output
- the stream to write the output tobuffer
- the byte array to take the characters fromoff
- the index of the first byte to quotelen
- the number of bytes to quote
IOException
public static String quoteHtmlChars(String item)
item
- the string to quote
public static OutputStream quoteOutputStream(OutputStream out) throws IOException
out
- the stream to write the quoted output to
IOException
- if the underlying output failspublic static String unquoteHtmlChars(String item)
item
- the string to unquote
public static void main(String[] args) throws Exception
Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |