Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Searchapp extends SimpleFileVisitor{
- @override
- public FileVisitResult visitFile(Path file, BasicFileAttributes attrs){
- PathMatcher matcher=FileSystems.getDefult().getPathMatcher("glob:*.{html,java}");
- Path name=file.getFileName();
- if(name!=null&& matcher.match(name)) System.out.println(file);
- return FileVisitorResult.CONTINUE;
- }
- public static void main(String[] args) {
- Files.walkFileTree(Path.get("c:/temp"),new Searchapp());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement