1. /*
  2. * @(#)FilenameFilter.java 1.22 03/01/23
  3. *
  4. * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package java.io;
  8. /**
  9. * Instances of classes that implement this interface are used to
  10. * filter filenames. These instances are used to filter directory
  11. * listings in the <code>list</code> method of class
  12. * <code>File</code>, and by the Abstract Window Toolkit's file
  13. * dialog component.
  14. *
  15. * @author Arthur van Hoff
  16. * @author Jonathan Payne
  17. * @version 1.22, 01/23/03
  18. * @see java.awt.FileDialog#setFilenameFilter(java.io.FilenameFilter)
  19. * @see java.io.File
  20. * @see java.io.File#list(java.io.FilenameFilter)
  21. * @since JDK1.0
  22. */
  23. public
  24. interface FilenameFilter {
  25. /**
  26. * Tests if a specified file should be included in a file list.
  27. *
  28. * @param dir the directory in which the file was found.
  29. * @param name the name of the file.
  30. * @return <code>true</code> if and only if the name should be
  31. * included in the file list; <code>false</code> otherwise.
  32. */
  33. boolean accept(File dir, String name);
  34. }