Example usage for org.apache.commons.io.filefilter IOFileFilter getClass

List of usage examples for org.apache.commons.io.filefilter IOFileFilter getClass

Introduction

In this page you can find the example usage for org.apache.commons.io.filefilter IOFileFilter getClass.

Prototype

@HotSpotIntrinsicCandidate
public final native Class<?> getClass();

Source Link

Document

Returns the runtime class of this Object .

Usage

From source file:fr.duminy.jbackup.core.filter.JexlFileFilterTest.java

/**
 * Method copied from {@link org.apache.commons.io.filefilter.RegexFileFilterTestCase#assertFiltering(org.apache.commons.io.filefilter.IOFileFilter, java.io.File, boolean)}.
 * TODO check potential license issue.//from  w  w  w .  j a  va  2  s .  c  o m
 *
 * @param filter
 * @param file
 * @param expected
 * @throws Exception
 */
public void assertFiltering(final IOFileFilter filter, final File file, final boolean expected)
        throws Exception {
    // Note. This only tests the (File, String) version if the parent of
    //       the File passed in is not null
    assertThat(filter.accept(file))
            .as("Source(File) " + filter.getClass().getName() + " not " + expected + " for " + file)
            .isEqualTo(expected);

    if (file != null && file.getParentFile() != null) {
        assertThat(filter.accept(file.getParentFile(), file.getName()))
                .as("Source(File, String) " + filter.getClass().getName() + " not " + expected + " for " + file)
                .isEqualTo(expected);
    }
}