Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CODE IN JAVA Write a static method static boolean isDirectory(String filePath), that takes as an argument the path of a the file and returns a

CODE IN JAVA

Write a static method static boolean isDirectory(String filePath), that takes as an argument the path of a the file and returns a boolean value whether the given path represents a directory. If the file with the given path doesnt exist, throw a custom exception (checked) called PathNotFoundException with a meaningful message. Create the class for the custom exception. In the main method, call isDirectory method, handle the possible exception. If the exception occurs, catch it and print out the message. The execution of the main method should not be halted by the possible exceptions.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Microsoft Visual Basic 2008 Comprehensive Concepts And Techniques

Authors: Gary B. Shelly, Corinne Hoisington

1st Edition

1423927168, 978-1423927167

More Books

Students also viewed these Databases questions