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

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

Introduction

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

Prototype

public boolean hasQuery() 

Source Link

Document

Tell whether or not this URI has query.

Usage

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

/**
 * // w ww . j  a  v  a 2 s . c  o m
 * @param uri
 * @return whether the current link has a proper extension (link.html)
 * @throws URIException
 */
private boolean isLinkWithProperExtension(URI uri) throws URIException {
    if (uri.hasQuery()) {
        return false;
    }
    String path = uri.getPath();
    if (StringUtils.isBlank(path) || StringUtils.equals(path, SLASH_CHAR)) {
        return false;
    }
    int lastSlash = StringUtils.lastIndexOf(path, SLASH_CHAR);
    if (StringUtils.substring(path, lastSlash).contains(POINT_CHAR)) {
        return true;
    }

    return false;
}