Example usage for org.apache.commons.httpclient URI hasFragment

List of usage examples for org.apache.commons.httpclient URI hasFragment

Introduction

In this page you can find the example usage for org.apache.commons.httpclient URI hasFragment.

Prototype

public boolean hasFragment() 

Source Link

Document

Tell whether or not this URI has fragment.

Usage

From source file:org.opens.tanaguru.ruleimplementation.link.AbstractDownloadableLinkRuleImplementation.java

@Override
protected void select(SSPHandler sspHandler, ElementHandler elementHandler) {
    super.select(sspHandler, elementHandler);
    Iterator<Element> iter = ((Collection<Element>) elementHandler.get()).iterator();
    Element el;//  w  w  w  . jav  a 2 s  . c  om
    while (iter.hasNext()) {
        el = iter.next();
        try {
            URI uri = new URI(el.absUrl(HREF_ATTR), true);
            if (isLinkWithProperExtension(uri)) {
                if (uri.hasFragment()) {
                    iter.remove();
                } else {
                    linkWithSimpleExtension.add(el);
                }
            }
        } catch (URIException use) {
        }
    }
}