From d5b62651a08cc78fd2539df27e676d28f2afcb98 Mon Sep 17 00:00:00 2001 From: Shreya Malviya Date: Wed, 28 Sep 2022 16:23:47 +0530 Subject: [PATCH] Island: Implement delete_files_by_pattern() in FileRepositoryLoggingDecorator --- .../cc/repository/file_repository_logging_decorator.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/monkey/monkey_island/cc/repository/file_repository_logging_decorator.py b/monkey/monkey_island/cc/repository/file_repository_logging_decorator.py index 2bf8bfe6e..099b79106 100644 --- a/monkey/monkey_island/cc/repository/file_repository_logging_decorator.py +++ b/monkey/monkey_island/cc/repository/file_repository_logging_decorator.py @@ -26,6 +26,10 @@ class FileRepositoryLoggingDecorator(IFileRepository): logger.debug(f"Deleting file {unsafe_file_name}") return self._file_repository.delete_file(unsafe_file_name) + def delete_files_by_pattern(self, file_name_pattern: str): + logger.debug(f'Deleting files whose names match the pattern "{file_name_pattern}"') + return self._file_repository.delete_files_by_pattern(file_name_pattern) + def delete_all_files(self): logger.debug("Deleting all files in the repository") return self._file_repository.delete_all_files()