Example usage for org.apache.commons.vfs2 FileName equals

List of usage examples for org.apache.commons.vfs2 FileName equals

Introduction

In this page you can find the example usage for org.apache.commons.vfs2 FileName equals.

Prototype

public boolean equals(Object obj) 

Source Link

Document

Indicates whether some other object is "equal to" this one.

Usage

From source file:org.metaborg.intellij.jps.projects.JpsProjectService.java

/**
 * Determines whether the specified file is equal to or a descendant of the specified path.
 *
 * @param ancestor   The path./*  w w  w  .  j  a  v a  2 s  .c  o m*/
 * @param descendant The descendant.
 * @return <code>true</code> when the file is equal to or a descendant of the path;
 * otherwise, <code>false</code>.
 */
private boolean isEqualOrDescendant(final String ancestor, final FileObject descendant) {
    final FileObject contentRoot = this.resourceService.resolve(ancestor);
    final FileName lhs = contentRoot.getName();
    final FileName rhs = descendant.getName();
    return lhs.equals(rhs) || lhs.isDescendent(rhs);
}