FileFilter
Stay organized with collections
Save and categorize content based on your preferences.
A filter for abstract pathnames.
Instances of this interface may be passed to the listFiles(FileFilter)
method
of the File
class.
Public Method Summary
abstract
boolean
|
accept( File pathname)
Tests whether or not the specified abstract pathname should be
included in a pathname list.
|
Public Methods
public
abstract
boolean
accept
(File pathname)
Tests whether or not the specified abstract pathname should be
included in a pathname list.
Parameters
pathname |
The abstract pathname to be tested |
Returns
true
if and only if pathname
should be included
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-07-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-07-10 UTC."],[[["\u003cp\u003e\u003ccode\u003eFileFilter\u003c/code\u003e is an interface used for filtering abstract pathnames, primarily for use with the \u003ccode\u003elistFiles()\u003c/code\u003e method of the \u003ccode\u003eFile\u003c/code\u003e class.\u003c/p\u003e\n"],["\u003cp\u003eImplementations of the \u003ccode\u003eFileFilter\u003c/code\u003e interface must provide an \u003ccode\u003eaccept()\u003c/code\u003e method that determines whether a given \u003ccode\u003eFile\u003c/code\u003e object should be included in a list.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eaccept()\u003c/code\u003e method takes a \u003ccode\u003eFile\u003c/code\u003e object as input and returns \u003ccode\u003etrue\u003c/code\u003e if the file should be included in the list, otherwise \u003ccode\u003efalse\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# FileFilter\n\npublic interface **FileFilter** \nA filter for abstract pathnames.\n\nInstances of this interface may be passed to the [listFiles(FileFilter)](../../../reference/java/io/File.html#listFiles(java.io.FileFilter)) method\nof the [File](../../../reference/java/io/File.html) class. \n\n### Public Method Summary\n\n|------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract boolean | [accept](../../../reference/java/io/FileFilter.html#accept(java.io.File))([File](../../../reference/java/io/File.html) pathname) Tests whether or not the specified abstract pathname should be included in a pathname list. |\n\nPublic Methods\n--------------\n\n#### public abstract boolean\n**accept**\n([File](../../../reference/java/io/File.html) pathname)\n\nTests whether or not the specified abstract pathname should be\nincluded in a pathname list. \n\n##### Parameters\n\n| pathname | The abstract pathname to be tested |\n|----------|------------------------------------|\n\n##### Returns\n\n- `true` if and only if `pathname` should be included"]]