/* * [JETTempFilter.java] * * Summary: Select dirs that contain JET temp files. * * Copyright: (c) 2012-2017 Roedy Green, Canadian Mind Products, http://mindprod.com * * Licence: This software may be copied and used freely for any purpose but military. * http://mindprod.com/contact/nonmil.html * * Requires: JDK 1.8+ * * Created with: JetBrains IntelliJ IDEA IDE http://www.jetbrains.com/idea/ * * Version History: * 1.0 2012-01-13 initial version. */ package com.mindprod.batik; import java.io.File; import java.io.FilenameFilter; /** * Select dirs that contain JET temp files. * * @author Roedy Green, Canadian Mind Products * @version 1.0 2012-01-13 initial version. * @since 2012-01-13 */ final class JETTempFilter implements FilenameFilter { /** * Select only Files ending with our string. * * @param dir the directory in which the file was found. * @param name the name of the file. * * @return true if and only if the name should be included in the file list; false otherwise. */ public boolean accept( File dir, String name ) { final File f = new File( dir, name ); if ( !f.isDirectory() ) { return false; } final String lc = name.toLowerCase(); return lc.endsWith( "_jetpdb" ) || lc.endsWith( "_trial_run" ); } }