Skip to content

Commit

Permalink
Added comments for 'deleteEmptyDirectoryAndParent' method for better …
Browse files Browse the repository at this point in the history
…code readability and understanding of its functionality.
  • Loading branch information
Nurgul Amat committed Nov 20, 2023
1 parent 25df3e6 commit 0f1ec74
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,13 @@ public Void invoke(File file, VirtualChannel channel) throws IOException {
return null;
}

/**
* Deletes the specified directory if it is empty and its parent is the archive root directory.
* Additionally, deletes the parent directories recursively.
*
* @param directory The directory to be deleted.
* @throws IOException If an I/O error occurs.
*/
void deleteEmptyDirectoryAndParent(File directory) throws IOException {
if (isDirectoryEmpty(directory.toPath()) && isArchiveRootDirectory(directory.getParentFile())) {
Util.deleteFile(directory);
Expand Down

0 comments on commit 0f1ec74

Please sign in to comment.