DirectoryNotEmptyException

  • DirectoryNotEmptyException signals that a file system operation failed because the target directory is not empty.

  • It's a checked exception, meaning it must be explicitly handled in your code.

  • This exception inherits from FileSystemException and provides a constructor to specify the directory path.

  • You can access details about the exception using methods like getMessage(), getFile(), and getReason().

public class DirectoryNotEmptyException extends FileSystemException

Checked exception thrown when a file system operation fails because a directory is not empty.

Public Constructor Summary

DirectoryNotEmptyException(String dir)
Constructs an instance of this class.

Inherited Method Summary

Public Constructors

public DirectoryNotEmptyException (String dir)

Constructs an instance of this class.

Parameters
dir a string identifying the directory or null if not known