Problem

Modify this chapter’s DirectoryDescription program to print name and size information for...

Modify this chapter’s DirectoryDescription program to print name and size information for only those files whose “glob” pattern matches a user-specified string. To do this, you’ll need to prompt for and read the desired “glob” pattern. In addition to

Scanner,
you’ll need to use the Java API
FileSystem
and
PathMatcher
classes to create a
matcher
object like that in the
FileVisitor
constructor in Figure. Then, you’ll need to put the for-each loop’s
printf
statement inside an
if
statement whose condition is something like
matcher.matches(name),
where
name = path.getFileName().

Figure FileVisitor class–part A

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
Solutions For Problems in Chapter 16
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT