Java Doc for PathMatcher.java in  » IDE-Netbeans » project.ant » org » netbeans » spi » project » support » ant » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » IDE Netbeans » project.ant » org.netbeans.spi.project.support.ant 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.netbeans.spi.project.support.ant.PathMatcher

PathMatcher
final public class PathMatcher (Code)
Utility to match Ant-style file patterns with extended glob syntax.

A path matcher can be given an optional list of include patterns, and an optional list of exclude patterns. A given file path matches the pattern if it is matched by at least one include pattern (or there is a null includes list), and is not matched by any of the exclude patterns (if this list is not null).

The format is based on Ant patterns. Some details:

  • A file path to be matched must be a /-separated relative path from an unspecified base directory. A path representing a folder must end in /, except for the path representing the root folder, which is the empty string. Thus, the full path to a file is always the simple concatenation of the path to its containing folder, and the file's basename.
  • An include or exclude list, if not null, is a list of nonempty patterns separated by spaces and/or commas. It may be an empty list; this is equivalent to null in the case of excludes, but in the case of includes means that nothing matches.
  • A pattern may use either / or \ as a path separator interchangeably.
  • Most characters in a pattern match literally, and match a complete file path. A folder path ends in /, so the pattern foo will not match a folder named foo.
  • * in a pattern matches zero or more characters within a path component (i.e. not including /).
  • ** matches zero or more complete path components. It must be preceded by a slash (or be at the beginning of the pattern) and be followed by a slash (or be at the end of the pattern).
  • foo/ is treated the same as foo/** and matches the whole tree rooted at the folder foo.
  • /**/ can match just a single /. **/ and /** can match the empty string at path boundaries.

Some example patterns:

foo/bar/
The folder foo/bar and anything inside it.
foo/bar/baz
The file foo/bar/baz.
**/foo/
Any folder named foo and anything inside it.
**/*.java
Any Java source file (even in the default package).

since:
   org.netbeans.modules.project.ant/1 1.15
author:
   Jesse Glick



Constructor Summary
public  PathMatcher(String includes, String excludes, File base)
     Create a path matching object.

Method Summary
public  Set<File>findIncludedRoots()
     Find folders which match although their parent folders do not; or folders which do not match but which contain files which do.
public  booleanmatches(String path, boolean useKnownIncludes)
     Check whether a given path matches some includes (if not null) and no excludes.
public  StringtoString()
    


Constructor Detail
PathMatcher
public PathMatcher(String includes, String excludes, File base)(Code)
Create a path matching object. It is faster to create one matcher and call PathMatcher.matches multiple times than to recreate a matcher for each query.
Parameters:
  includes - a list of paths to match, or null to match everything by default
Parameters:
  excludes - a list of paths to not match, or null
Parameters:
  base - a base directory to scan for known include roots (see PathMatcher.findIncludedRoots), or null if unknown




Method Detail
findIncludedRoots
public Set<File> findIncludedRoots() throws IllegalArgumentException(Code)
Find folders which match although their parent folders do not; or folders which do not match but which contain files which do.
  • Wildcard-free folder include paths, such as foo/bar/ (or the equivalent foo/bar/**), are returned directly if they are not excluded.
  • Wildcard-using paths trigger a scan of the provided root directory. Any actual files or folders found beneath that root which PathMatcher.matches match are noted, and their minimal paths are returned.
  • If a file matches but its containing folder does not, and the file exists, the folder is listed as an include root.
  • If this matcher has a null includes list, just the root folder is returned.
a set of minimal included folders



matches
public boolean matches(String path, boolean useKnownIncludes)(Code)
Check whether a given path matches some includes (if not null) and no excludes.
Parameters:
  path - a relative file path as described in class Javadoc
Parameters:
  useKnownIncludes - true to also match in case this path is a parent of some known included root true for a match



toString
public String toString()(Code)



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.