Join David Gassner for an in-depth discussion in this video Finding files, part of Advanced Java Programming (2012).
Once you've learned how to walk the file and directory tree using the new Java 7 Files API,…you can then use another new object called a Path Matcher to look at the names of each…file as you encounter them and find particular files based on the files names.…I'll show how to do this using this project FindingFiles.…As with the previous project, I have a files folder with two directories and each directory…has a couple of uniquely named files.…To find a file, you'll want to create a class that extends SimpleFileVisitor.…
This is the same sort of class that you used to walk the directory tree.…In this case, I'm going to be using the directory tree to examine each file one at a time,…and I'm going to need to create an instance of the PathMatcher object.…I'll start with my cursor inside the class definition but outside any methods.…And I'll declare a new private variable data typed as PathMatcher.…I'll add the import statement and show that the PathMatcher is an interface that's a part of java.nio.file.…
- Installing Java on Windows and Mac OS X
- Installing Eclipse
- Using new features such as simplified generics
- Working with advanced class structures (member, local inner, etc.)
- Using the Reflection API
- Navigating inheritance trees
- Managing unordered and ordered sets
- Peeking and polling with queues
- Testing and error handling
- Managing files and directories
- Working with I/O streams
- Next steps with Java
Skill Level Advanced
1. Getting Started
2. Java 7 New Features
3. Using Advanced Class Structures
4. Using the Reflection API
5. More of the Collections Framework
6. Testing and Advanced Exception Handling
Using the finally keyword5m 40s
7. Managing Files and Directories in Java 7
8. Working with I/O Streams
9. Working with Multi-threading
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.