NotDirectoryException

  • NotDirectoryException signals that a file system operation targeting a directory failed because the specified file isn't a directory.

  • It's a checked exception, meaning it needs to be explicitly handled in your code using try-catch blocks or declared in the method signature.

  • The exception provides methods to retrieve the file path that caused the error and a reason for the failure.

  • NotDirectoryException inherits from FileSystemException and ultimately from Throwable, offering standard exception handling functionalities.

public class NotDirectoryException extends FileSystemException

Checked exception thrown when a file system operation, intended for a directory, fails because the file is not a directory.

Public Constructor Summary

NotDirectoryException(String file)
Constructs an instance of this class.

Inherited Method Summary

Public Constructors

public NotDirectoryException (String file)

Constructs an instance of this class.

Parameters
file a string identifying the file or null if not known