org.apache.abdera.ext.media.MediaHash

Here are the examples of the java api class org.apache.abdera.ext.media.MediaHash taken from open source projects.

1. MediaHashTagHandler#doEndTag()

Project: sling
File: MediaHashTagHandler.java
@Override
public int doEndTag() throws JspException {
    final ServletRequest request = pageContext.getRequest();
    MediaHash hash;
    if (request.getAttribute("content") != null && request.getAttribute("content") instanceof MediaContent) {
        hash = ((MediaContent) request.getAttribute("content")).addExtension(MediaConstants.HASH);
    } else if (request.getAttribute("group") != null && request.getAttribute("group") instanceof MediaGroup) {
        hash = ((MediaGroup) request.getAttribute("group")).addExtension(MediaConstants.HASH);
    } else if (request.getAttribute("entry") != null && request.getAttribute("entry") instanceof Entry) {
        hash = ((Entry) request.getAttribute("entry")).addExtension(MediaConstants.HASH);
    } else {
        hash = ((Feed) request.getAttribute("feed")).addExtension(MediaConstants.HASH);
    }
    // set the body content
    hash.setText(getBodyContent().getString());
    // set the scheme
    if (algo != null)
        hash.setAlgorithm(Algo.valueOf(algo));
    return super.doEndTag();
}