Examples of MediaHash


Examples of org.apache.abdera.ext.media.MediaHash

    @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();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.