Stay organized with collections
Save and categorize content based on your preferences.
PathMatcher
public
interface
PathMatcher
java.nio.file.PathMatcher
|
An interface that is implemented by objects that perform match operations on
paths.
Summary
Public methods |
abstract
boolean
|
matches(Path path)
Tells if given path matches this matcher's pattern.
|
Public methods
matches
public abstract boolean matches (Path path)
Tells if given path matches this matcher's pattern.
Parameters |
path |
Path : the path to match |
Returns |
boolean |
true if, and only if, the path matches this
matcher's pattern |
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.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# PathMatcher\n\nAdded in [API level 26](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\nPathMatcher\n===========\n\n\n`\npublic\n\n\ninterface\nPathMatcher\n`\n\n\n`\n\n\n`\n\n|---------------------------|\n| java.nio.file.PathMatcher |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nAn interface that is implemented by objects that perform match operations on\npaths. \n**See also:**\n\n- [FileSystem.getPathMatcher(String)](/reference/java/nio/file/FileSystem#getPathMatcher(java.lang.String))\n- [Files.newDirectoryStream(Path, String)](/reference/java/nio/file/Files#newDirectoryStream(java.nio.file.Path,%20java.lang.String))\n\nSummary\n-------\n\n| ### Public methods ||\n|---------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract boolean` | ` `[matches](/reference/java/nio/file/PathMatcher#matches(java.nio.file.Path))`(`[Path](/reference/java/nio/file/Path)` path) ` Tells if given path matches this matcher's pattern. |\n\nPublic methods\n--------------\n\n### matches\n\nAdded in [API level 26](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract boolean matches (Path path)\n```\n\nTells if given path matches this matcher's pattern.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|--------|----------------------------------|\n| `path` | `Path`: the path to match \u003cbr /\u003e |\n\n| Returns ||\n|-----------|------------------------------------------------------------------------|\n| `boolean` | `true` if, and only if, the path matches this matcher's pattern \u003cbr /\u003e |"]]