<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://jexp.ru/index.php?action=history&amp;feed=atom&amp;title=Java_Tutorial%2FFile%2FFilenameFilter</id>
		<title>Java Tutorial/File/FilenameFilter - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://jexp.ru/index.php?action=history&amp;feed=atom&amp;title=Java_Tutorial%2FFile%2FFilenameFilter"/>
		<link rel="alternate" type="text/html" href="http://jexp.ru/index.php?title=Java_Tutorial/File/FilenameFilter&amp;action=history"/>
		<updated>2026-04-10T10:57:27Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://jexp.ru/index.php?title=Java_Tutorial/File/FilenameFilter&amp;diff=5374&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://jexp.ru/index.php?title=Java_Tutorial/File/FilenameFilter&amp;diff=5374&amp;oldid=prev"/>
				<updated>2010-06-01T05:20:02Z</updated>
		
		<summary type="html">&lt;p&gt;1 версия&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 05:20, 1 июня 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;text-align: center;&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	<entry>
		<id>http://jexp.ru/index.php?title=Java_Tutorial/File/FilenameFilter&amp;diff=5373&amp;oldid=prev</id>
		<title> в 17:44, 31 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://jexp.ru/index.php?title=Java_Tutorial/File/FilenameFilter&amp;diff=5373&amp;oldid=prev"/>
				<updated>2010-05-31T17:44:27Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==  A filesystem filter. ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
/* &lt;br /&gt;
 * JCommon : a free general purpose class library for the Java(tm) platform&lt;br /&gt;
 * &lt;br /&gt;
 *&lt;br /&gt;
 * (C) Copyright 2000-2005, by Object Refinery Limited and Contributors.&lt;br /&gt;
 *&lt;br /&gt;
 * Project Info:  http://www.jfree.org/jcommon/index.html&lt;br /&gt;
 *&lt;br /&gt;
 * This library is free software; you can redistribute it and/or modify it&lt;br /&gt;
 * under the terms of the GNU Lesser General Public License as published by&lt;br /&gt;
 * the Free Software Foundation; either version 2.1 of the License, or&lt;br /&gt;
 * (at your option) any later version.&lt;br /&gt;
 *&lt;br /&gt;
 * This library is distributed in the hope that it will be useful, but&lt;br /&gt;
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY&lt;br /&gt;
 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public&lt;br /&gt;
 * License for more details.&lt;br /&gt;
 *&lt;br /&gt;
 * You should have received a copy of the GNU Lesser General Public&lt;br /&gt;
 * License along with this library; if not, write to the Free Software&lt;br /&gt;
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,&lt;br /&gt;
 * USA.&lt;br /&gt;
 *&lt;br /&gt;
 * [Java is a trademark or registered trademark of Sun Microsystems, Inc.&lt;br /&gt;
 * in the United States and other countries.]&lt;br /&gt;
 *&lt;br /&gt;
 * ------------------------&lt;br /&gt;
 * ExtensionFileFilter.java&lt;br /&gt;
 * ------------------------&lt;br /&gt;
 * (C) Copyright 2000-2004, by Object Refinery Limited.&lt;br /&gt;
 *&lt;br /&gt;
 * Original Author:  David Gilbert (for Object Refinery Limited);&lt;br /&gt;
 * Contributor(s):   -;&lt;br /&gt;
 *&lt;br /&gt;
 * $Id: FilesystemFilter.java,v 1.6 2008/09/10 09:26:11 mungady Exp $&lt;br /&gt;
 *&lt;br /&gt;
 * Changes (from 26-Oct-2001)&lt;br /&gt;
 * --------------------------&lt;br /&gt;
 * 01-Jun-2005 : Updated javadoc.&lt;br /&gt;
 */&lt;br /&gt;
import java.io.File;&lt;br /&gt;
import java.io.FilenameFilter;&lt;br /&gt;
import javax.swing.filechooser.FileFilter;&lt;br /&gt;
/**&lt;br /&gt;
 * A filesystem filter.&lt;br /&gt;
 * &lt;br /&gt;
 * @author David Gilbert&lt;br /&gt;
 */&lt;br /&gt;
public class FilesystemFilter extends FileFilter implements FilenameFilter {&lt;br /&gt;
  /** The file extension, which should be accepted. */&lt;br /&gt;
  private String[] fileext;&lt;br /&gt;
  /** The filter description. */&lt;br /&gt;
  private String descr;&lt;br /&gt;
  /** A flag indicating whether to accept directories. */&lt;br /&gt;
  private boolean accDirs;&lt;br /&gt;
  /**&lt;br /&gt;
   * Creates a new filter.&lt;br /&gt;
   * &lt;br /&gt;
   * @param fileext&lt;br /&gt;
   *          the file extension.&lt;br /&gt;
   * @param descr&lt;br /&gt;
   *          the description.&lt;br /&gt;
   */&lt;br /&gt;
  public FilesystemFilter(final String fileext, final String descr) {&lt;br /&gt;
    this(fileext, descr, true);&lt;br /&gt;
  }&lt;br /&gt;
  /**&lt;br /&gt;
   * Creates a new filter.&lt;br /&gt;
   * &lt;br /&gt;
   * @param fileext&lt;br /&gt;
   *          the file extension.&lt;br /&gt;
   * @param descr&lt;br /&gt;
   *          the description.&lt;br /&gt;
   * @param accDirs&lt;br /&gt;
   *          accept directories?&lt;br /&gt;
   */&lt;br /&gt;
  public FilesystemFilter(final String fileext, final String descr, final boolean accDirs) {&lt;br /&gt;
    this(new String[] { fileext }, descr, accDirs);&lt;br /&gt;
  }&lt;br /&gt;
  /**&lt;br /&gt;
   * Creates a new filter.&lt;br /&gt;
   * &lt;br /&gt;
   * @param fileext&lt;br /&gt;
   *          the file extension.&lt;br /&gt;
   * @param descr&lt;br /&gt;
   *          the description.&lt;br /&gt;
   * @param accDirs&lt;br /&gt;
   *          accept directories?&lt;br /&gt;
   * @throws NullPointerException&lt;br /&gt;
   *           if the file extensions are null.&lt;br /&gt;
   */&lt;br /&gt;
  public FilesystemFilter(final String[] fileext, final String descr, final boolean accDirs) {&lt;br /&gt;
    this.fileext = (String[]) fileext.clone();&lt;br /&gt;
    this.descr = descr;&lt;br /&gt;
    this.accDirs = accDirs;&lt;br /&gt;
  }&lt;br /&gt;
  /**&lt;br /&gt;
   * Returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the file is accepted, and &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;&lt;br /&gt;
   * otherwise.&lt;br /&gt;
   * &lt;br /&gt;
   * @param dir&lt;br /&gt;
   *          the directory.&lt;br /&gt;
   * @param name&lt;br /&gt;
   *          the file name.&lt;br /&gt;
   * @return A boolean.&lt;br /&gt;
   */&lt;br /&gt;
  public boolean accept(final File dir, final String name) {&lt;br /&gt;
    final File f = new File(dir, name);&lt;br /&gt;
    if (f.isDirectory() &amp;amp;&amp;amp; acceptsDirectories()) {&lt;br /&gt;
      return true;&lt;br /&gt;
    }&lt;br /&gt;
    for (int i = 0; i &amp;lt; this.fileext.length; i++) {&lt;br /&gt;
      if (name.endsWith(this.fileext[i])) {&lt;br /&gt;
        return true;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
    return false;&lt;br /&gt;
  }&lt;br /&gt;
  /**&lt;br /&gt;
   * Returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the specified file matches the requirements&lt;br /&gt;
   * of this filter, and &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; otherwise.&lt;br /&gt;
   * &lt;br /&gt;
   * @param dir&lt;br /&gt;
   *          the file or directory.&lt;br /&gt;
   * @return A boolean.&lt;br /&gt;
   */&lt;br /&gt;
  public boolean accept(final File dir) {&lt;br /&gt;
    if (dir.isDirectory() &amp;amp;&amp;amp; acceptsDirectories()) {&lt;br /&gt;
      return true;&lt;br /&gt;
    }&lt;br /&gt;
    for (int i = 0; i &amp;lt; this.fileext.length; i++) {&lt;br /&gt;
      if (dir.getName().endsWith(this.fileext[i])) {&lt;br /&gt;
        return true;&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
    return false;&lt;br /&gt;
  }&lt;br /&gt;
  /**&lt;br /&gt;
   * Returns the filter description.&lt;br /&gt;
   * &lt;br /&gt;
   * @return The filter description.&lt;br /&gt;
   */&lt;br /&gt;
  public String getDescription() {&lt;br /&gt;
    return this.descr;&lt;br /&gt;
  }&lt;br /&gt;
  /**&lt;br /&gt;
   * Sets the flag that controls whether or not the filter accepts directories.&lt;br /&gt;
   * &lt;br /&gt;
   * @param b&lt;br /&gt;
   *          a boolean.&lt;br /&gt;
   */&lt;br /&gt;
  public void acceptDirectories(final boolean b) {&lt;br /&gt;
    this.accDirs = b;&lt;br /&gt;
  }&lt;br /&gt;
  /**&lt;br /&gt;
   * Returns the flag that indicates whether or not the filter accepts&lt;br /&gt;
   * directories.&lt;br /&gt;
   * &lt;br /&gt;
   * @return A boolean.&lt;br /&gt;
   */&lt;br /&gt;
  public boolean acceptsDirectories() {&lt;br /&gt;
    return this.accDirs;&lt;br /&gt;
  }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- end source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==  A prefix based filename filter ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
  * JBoss, Home of Professional Open Source&lt;br /&gt;
  * Copyright 2005, JBoss Inc., and individual contributors as indicated&lt;br /&gt;
  * by the @authors tag. See the copyright.txt in the distribution for a&lt;br /&gt;
  * full listing of individual contributors.&lt;br /&gt;
  *&lt;br /&gt;
  * This is free software; you can redistribute it and/or modify it&lt;br /&gt;
  * under the terms of the GNU Lesser General Public License as&lt;br /&gt;
  * published by the Free Software Foundation; either version 2.1 of&lt;br /&gt;
  * the License, or (at your option) any later version.&lt;br /&gt;
  *&lt;br /&gt;
  * This software is distributed in the hope that it will be useful,&lt;br /&gt;
  * but WITHOUT ANY WARRANTY; without even the implied warranty of&lt;br /&gt;
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU&lt;br /&gt;
  * Lesser General Public License for more details.&lt;br /&gt;
  *&lt;br /&gt;
  * You should have received a copy of the GNU Lesser General Public&lt;br /&gt;
  * License along with this software; if not, write to the Free&lt;br /&gt;
  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA&lt;br /&gt;
  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.&lt;br /&gt;
  */&lt;br /&gt;
import java.io.File;&lt;br /&gt;
import java.io.FilenameFilter;&lt;br /&gt;
/**&lt;br /&gt;
 * A &amp;lt;em&amp;gt;prefix&amp;lt;/em&amp;gt; based filename filter.&lt;br /&gt;
 *&lt;br /&gt;
 * @version &amp;lt;tt&amp;gt;$Revision: 1958 $&amp;lt;/tt&amp;gt;&lt;br /&gt;
 * @author  &lt;br /&gt;
 */&lt;br /&gt;
public class FilenamePrefixFilter&lt;br /&gt;
   implements FilenameFilter&lt;br /&gt;
{&lt;br /&gt;
   /** The prefix which files must have to be accepted. */&lt;br /&gt;
   protected final String prefix;&lt;br /&gt;
   /** Flag to signal that we want to ignore the case. */&lt;br /&gt;
   protected final boolean ignoreCase;&lt;br /&gt;
   /**&lt;br /&gt;
    * Construct a &amp;lt;tt&amp;gt;FilenamePrefixFilter&amp;lt;/tt&amp;gt;.&lt;br /&gt;
    *&lt;br /&gt;
    * @param prefix     The prefix which files must have to be accepted.&lt;br /&gt;
    * @param ignoreCase &amp;lt;tt&amp;gt;True&amp;lt;/tt&amp;gt; if the filter should be case-insensitive.&lt;br /&gt;
    */&lt;br /&gt;
   public FilenamePrefixFilter(final String prefix,&lt;br /&gt;
                               final boolean ignoreCase)&lt;br /&gt;
   {&lt;br /&gt;
      this.ignoreCase = ignoreCase;&lt;br /&gt;
      this.prefix = (ignoreCase ? prefix.toLowerCase() : prefix);&lt;br /&gt;
   }&lt;br /&gt;
   /**&lt;br /&gt;
    * Construct a case sensitive &amp;lt;tt&amp;gt;FilenamePrefixFilter&amp;lt;/tt&amp;gt;.&lt;br /&gt;
    *&lt;br /&gt;
    * @param prefix  The prefix which files must have to be accepted.&lt;br /&gt;
    */&lt;br /&gt;
   public FilenamePrefixFilter(final String prefix) {&lt;br /&gt;
      this(prefix, false);&lt;br /&gt;
   }&lt;br /&gt;
   /**&lt;br /&gt;
    * Check if a file is acceptible.&lt;br /&gt;
    *&lt;br /&gt;
    * @param dir  The directory the file resides in.&lt;br /&gt;
    * @param name The name of the file.&lt;br /&gt;
    * @return     &amp;lt;tt&amp;gt;true&amp;lt;/tt&amp;gt; if the file is acceptable.&lt;br /&gt;
    */&lt;br /&gt;
   public boolean accept(final File dir, final String name) {&lt;br /&gt;
      if (ignoreCase) {&lt;br /&gt;
         return name.toLowerCase().startsWith(prefix);&lt;br /&gt;
      }&lt;br /&gt;
      else {&lt;br /&gt;
         return name.startsWith(prefix);&lt;br /&gt;
      }&lt;br /&gt;
   }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- end source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==  Combine FilenameFilter and Pattern match to create a dir command ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
import java.io.File;&lt;br /&gt;
import java.io.FilenameFilter;&lt;br /&gt;
import java.util.Arrays;&lt;br /&gt;
import java.util.regex.Pattern;&lt;br /&gt;
public class MainClass {&lt;br /&gt;
  public static void main(final String[] args) {&lt;br /&gt;
    File path = new File(&amp;quot;.&amp;quot;);&lt;br /&gt;
    String[] list;&lt;br /&gt;
    if (args.length == 0)&lt;br /&gt;
      list = path.list();&lt;br /&gt;
    else&lt;br /&gt;
      list = path.list(new FilenameFilter() {&lt;br /&gt;
        private Pattern pattern = Pattern.rupile(args[0]);&lt;br /&gt;
        public boolean accept(File dir, String name) {&lt;br /&gt;
          return pattern.matcher(new File(name).getName()).matches();&lt;br /&gt;
        }&lt;br /&gt;
      });&lt;br /&gt;
    Arrays.sort(list);&lt;br /&gt;
    for (int i = 0; i &amp;lt; list.length; i++)&lt;br /&gt;
      System.out.println(list[i]);&lt;br /&gt;
  }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- end source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==  File filter: retrieve at most predefined number of files which are older than specified data ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
 * Copyright (c) 2003 - 2007 OpenSubsystems s.r.o. Slovak Republic. All rights reserved.&lt;br /&gt;
 * &lt;br /&gt;
 * Project: OpenSubsystems&lt;br /&gt;
 * &lt;br /&gt;
 * $Id: MaximumFileFilter.java,v 1.4 2007/01/07 06:14:00 bastafidli Exp $&lt;br /&gt;
 * &lt;br /&gt;
 * This program is free software; you can redistribute it and/or modify&lt;br /&gt;
 * it under the terms of the GNU General Public License as published by&lt;br /&gt;
 * the Free Software Foundation; version 2 of the License. &lt;br /&gt;
 * &lt;br /&gt;
 * This program is distributed in the hope that it will be useful,&lt;br /&gt;
 * but WITHOUT ANY WARRANTY; without even the implied warranty of&lt;br /&gt;
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the&lt;br /&gt;
 * GNU General Public License for more details.&lt;br /&gt;
 * &lt;br /&gt;
 * You should have received a copy of the GNU General Public License&lt;br /&gt;
 * along with this program; if not, write to the Free Software&lt;br /&gt;
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA &lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
import java.io.File;&lt;br /&gt;
import java.io.FilenameFilter;&lt;br /&gt;
import java.util.Date;&lt;br /&gt;
/**&lt;br /&gt;
 * File filter implementation to retrieve at most predefined number of files&lt;br /&gt;
 * which are older than specified data&lt;br /&gt;
 * &lt;br /&gt;
 * @version $Id: MaximumFileFilter.java,v 1.4 2007/01/07 06:14:00 bastafidli Exp $&lt;br /&gt;
 * @author Miro Halas&lt;br /&gt;
 * @code.reviewer Miro Halas&lt;br /&gt;
 * @code.reviewed 1.2 2004/12/18 06:18:25 bastafidli&lt;br /&gt;
 */&lt;br /&gt;
public class MaximumFileFilter implements FilenameFilter&lt;br /&gt;
{&lt;br /&gt;
   // Attributes ///////////////////////////////////////////////////////////////&lt;br /&gt;
   &lt;br /&gt;
   /**&lt;br /&gt;
    * Current number of files in list&lt;br /&gt;
    */&lt;br /&gt;
   protected int m_currentFileCount = 0;&lt;br /&gt;
   &lt;br /&gt;
   /**&lt;br /&gt;
    * Maximum number of files in output list&lt;br /&gt;
    */&lt;br /&gt;
   &lt;br /&gt;
   protected int m_iMaximum = 0;&lt;br /&gt;
   &lt;br /&gt;
   /**&lt;br /&gt;
    * Last modification time of file have to be before this date, if it is null, &lt;br /&gt;
    * modification date is not checked&lt;br /&gt;
    */&lt;br /&gt;
   protected Date m_dtOlderThan;&lt;br /&gt;
   &lt;br /&gt;
   // Constructors /////////////////////////////////////////////////////////////&lt;br /&gt;
   &lt;br /&gt;
   /**&lt;br /&gt;
    * Constructor with maximum count of file in the output list.&lt;br /&gt;
    *  &lt;br /&gt;
    * @param iMax - maximum number of files in output list. If it is 0 length of &lt;br /&gt;
    * @param dtOlderThen  - file last modification time heve to by before this &lt;br /&gt;
    *                       date, if it is null modification time is not checked&lt;br /&gt;
    *                       output list is unlimited.&lt;br /&gt;
    */&lt;br /&gt;
   &lt;br /&gt;
   public MaximumFileFilter(&lt;br /&gt;
      int  iMax,&lt;br /&gt;
      Date dtOlderThen&lt;br /&gt;
   )&lt;br /&gt;
   {&lt;br /&gt;
      m_iMaximum = iMax;&lt;br /&gt;
      m_dtOlderThan = dtOlderThen; &lt;br /&gt;
   }&lt;br /&gt;
   &lt;br /&gt;
   /**&lt;br /&gt;
    * {@inheritDoc}&lt;br /&gt;
    */&lt;br /&gt;
   public boolean accept(&lt;br /&gt;
      File   dir, &lt;br /&gt;
      String name&lt;br /&gt;
   )&lt;br /&gt;
   {&lt;br /&gt;
      File currentFile = new File(dir, name);&lt;br /&gt;
      &lt;br /&gt;
      if (currentFile.isDirectory())&lt;br /&gt;
      {&lt;br /&gt;
         return false;&lt;br /&gt;
      }&lt;br /&gt;
      if ((m_dtOlderThan != null) &amp;amp;&amp;amp; (currentFile.lastModified() &amp;gt; m_dtOlderThan.getTime()))&lt;br /&gt;
      {&lt;br /&gt;
         return false;&lt;br /&gt;
      }&lt;br /&gt;
      if ((m_iMaximum == 0) || (m_currentFileCount &amp;lt;= m_iMaximum))&lt;br /&gt;
      {&lt;br /&gt;
         m_currentFileCount++;&lt;br /&gt;
      }&lt;br /&gt;
      return  m_currentFileCount &amp;lt;= m_iMaximum;&lt;br /&gt;
   }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- end source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==  Filter files by name ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
import java.io.File;&lt;br /&gt;
import java.io.FileFilter;&lt;br /&gt;
import java.io.FilenameFilter;&lt;br /&gt;
public class Main {&lt;br /&gt;
  public static void main(String[] argv) throws Exception {&lt;br /&gt;
    File dir = new File(&amp;quot;c:\\temp&amp;quot;);&lt;br /&gt;
    FilenameFilter filter = new FilenameFilter() {&lt;br /&gt;
      public boolean accept(File dir, String name) {&lt;br /&gt;
        return !name.startsWith(&amp;quot;.&amp;quot;);&lt;br /&gt;
      }&lt;br /&gt;
    };&lt;br /&gt;
    String[] children = dir.list(filter);&lt;br /&gt;
    &lt;br /&gt;
  }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- end source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==  strip Extension name ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
import java.io.File;&lt;br /&gt;
&lt;br /&gt;
public class Main {&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
  /**&lt;br /&gt;
   * org/my/Class.xxx -&amp;gt; org/my/Class&lt;br /&gt;
   */&lt;br /&gt;
  public static String stripExtension( final String pResourceName ) {&lt;br /&gt;
      final int i = pResourceName.lastIndexOf(&amp;quot;.&amp;quot;);&lt;br /&gt;
      if (i &amp;lt; 0) {&lt;br /&gt;
          return pResourceName;&lt;br /&gt;
      }&lt;br /&gt;
      final String withoutExtension = pResourceName.substring(0, i);&lt;br /&gt;
      return withoutExtension;&lt;br /&gt;
  }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- end source code --&amp;gt;&lt;/div&gt;</summary>
			</entry>

	</feed>