Package org.apache.hadoop.hbase.http
Class HtmlQuoting
java.lang.Object
org.apache.hadoop.hbase.http.HtmlQuoting
This class is responsible for quoting HTML characters.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
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
Return an output stream that quotes all of the output.static String
unquoteHtmlChars
(String item) Remove HTML quoting from a string.
-
Field Details
-
ampBytes
-
aposBytes
-
gtBytes
-
ltBytes
-
quotBytes
-
-
Constructor Details
-
HtmlQuoting
private HtmlQuoting()
-
-
Method Details
-
needsQuoting
Does the given string need to be quoted?- Parameters:
data
- the string to checkoff
- the starting positionlen
- the number of bytes to check- Returns:
- does the string contain any of the active html characters?
-
needsQuoting
Does the given string need to be quoted?- Parameters:
str
- the string to check- Returns:
- does the string contain any of the active html characters?
-
quoteHtmlChars
public static void quoteHtmlChars(OutputStream output, byte[] buffer, int off, int len) throws IOException Quote all of the active HTML characters in the given string as they are added to the buffer.- Parameters:
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- Throws:
IOException
-
quoteHtmlChars
Quote the given item to make it html-safe.- Parameters:
item
- the string to quote- Returns:
- the quoted string
-
quoteOutputStream
Return an output stream that quotes all of the output.- Parameters:
out
- the stream to write the quoted output to- Returns:
- a new stream that the application show write to
-
unquoteHtmlChars
Remove HTML quoting from a string.- Parameters:
item
- the string to unquote- Returns:
- the unquoted string
-
main
-