Stay organized with collections
Save and categorize content based on your preferences.
FileFilter
public
interface
FileFilter
A filter for abstract pathnames.
Instances of this interface may be passed to the listFiles(FileFilter)
method
of the File
class.
Summary
Public methods |
abstract
boolean
|
accept(File pathname)
Tests whether or not the specified abstract pathname should be
included in a pathname list.
|
Public methods
accept
public abstract boolean accept (File pathname)
Tests whether or not the specified abstract pathname should be
included in a pathname list.
Parameters |
pathname |
File : The abstract pathname to be tested |
Returns |
boolean |
true if and only if pathname
should be included |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-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 2025-02-10 UTC."],[],[],null,["# FileFilter\n\nAdded in [API level 1](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\nFileFilter\n==========\n\n\n`\npublic\n\n\ninterface\nFileFilter\n`\n\n\n`\n\n\n`\n\n|--------------------|\n| java.io.FileFilter |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nA filter for abstract pathnames.\n\nInstances of this interface may be passed to the [listFiles(FileFilter)](/reference/java/io/File#listFiles(java.io.FileFilter)) method\nof the [File](/reference/java/io/File) class.\n\nSummary\n-------\n\n| ### Public methods ||\n|---------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract boolean` | ` `[accept](/reference/java/io/FileFilter#accept(java.io.File))`(`[File](/reference/java/io/File)` pathname) ` Tests whether or not the specified abstract pathname should be included in a pathname list. |\n\nPublic methods\n--------------\n\n### accept\n\nAdded in [API level 1](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract boolean accept (File pathname)\n```\n\nTests whether or not the specified abstract pathname should be\nincluded in a pathname list.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|------------|---------------------------------------------------|\n| `pathname` | `File`: The abstract pathname to be tested \u003cbr /\u003e |\n\n| Returns ||\n|-----------|------------------------------------------------------------|\n| `boolean` | `true` if and only if `pathname` should be included \u003cbr /\u003e |"]]