org.owasp.esapi.tags
Class EncodeForBase64Tag
java.lang.Object
javax.servlet.jsp.tagext.TagSupport
javax.servlet.jsp.tagext.BodyTagSupport
org.owasp.esapi.tags.BaseEncodeTag
org.owasp.esapi.tags.EncodeForBase64Tag
- All Implemented Interfaces:
- java.io.Serializable, javax.servlet.jsp.tagext.BodyTag, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.JspTag, javax.servlet.jsp.tagext.Tag
public class EncodeForBase64Tag
- extends BaseEncodeTag
JSP tag that encode's it's body using Base64.
- See Also:
- Serialized Form
Fields inherited from class javax.servlet.jsp.tagext.BodyTagSupport |
bodyContent |
Fields inherited from class javax.servlet.jsp.tagext.TagSupport |
id, pageContext |
Fields inherited from interface javax.servlet.jsp.tagext.BodyTag |
EVAL_BODY_BUFFERED, EVAL_BODY_TAG |
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag |
EVAL_BODY_AGAIN |
Fields inherited from interface javax.servlet.jsp.tagext.Tag |
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE |
Method Summary |
protected java.lang.String |
encode(java.lang.String content,
Encoder enc)
Encode tag's content using Base64. |
java.lang.String |
getEncoding()
Get the encoding used to convert the content to bytes for
encoding. |
boolean |
getWrap()
Get whether line wrapping at 64 characters is performed. |
void |
setEncoding(java.lang.String encoding)
Set the encoding used to convert the content to bytes for
encoding. |
void |
setWrap(boolean wrap)
Set whether line wrapping at 64 characters is performed. |
Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport |
doEndTag, doInitBody, doStartTag, getBodyContent, getPreviousOut, release, setBodyContent |
Methods inherited from class javax.servlet.jsp.tagext.TagSupport |
findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.servlet.jsp.tagext.Tag |
getParent, setPageContext, setParent |
EncodeForBase64Tag
public EncodeForBase64Tag()
encode
protected java.lang.String encode(java.lang.String content,
Encoder enc)
throws javax.servlet.jsp.JspTagException
- Encode tag's content using Base64.
- Specified by:
encode
in class BaseEncodeTag
- Parameters:
content
- The tag's content as a Stringenc
- Encoder used to call
Encoder.encodeForBase64(byte[], boolean)
- Returns:
- content encoded in Base64
- Throws:
javax.servlet.jsp.JspTagException
setEncoding
public void setEncoding(java.lang.String encoding)
- Set the encoding used to convert the content to bytes for
encoding. This defaults to UTF-8 if not specified.
- Parameters:
encoding
- The encoding passed to String.getBytes(String)
.
getEncoding
public java.lang.String getEncoding()
- Get the encoding used to convert the content to bytes for
encoding.
- Returns:
- encoding The encoding passed to
String.getBytes(String)
.
setWrap
public void setWrap(boolean wrap)
- Set whether line wrapping at 64 characters is performed. This
defaults to false.
- Parameters:
wrap
- flag determining wrapping.
getWrap
public boolean getWrap()
- Get whether line wrapping at 64 characters is performed. This
defaults to false.
- Returns:
- value of flag determining wrapping.
Copyright © 2010 The Open Web Application Security Project (OWASP). All Rights Reserved.