Class FileUtils
java.lang.Object
utils.FileUtils
Utility class for file operations.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidretryFileOperation(FileOperation operation, int maxRetries) Retries a file operation multiple times in case of transient failures.static booleanverifyFileIntegrity(Path source, Path target) Verifies the integrity of a file by comparing its size before and after copying.
-
Constructor Details
-
FileUtils
private FileUtils()Utility class — do not instantiate.
-
-
Method Details
-
retryFileOperation
Retries a file operation multiple times in case of transient failures.- Parameters:
operation- The file operation to execute.maxRetries- The maximum number of retries.- Throws:
IOException- If the operation fails after all retries.
-
verifyFileIntegrity
Verifies the integrity of a file by comparing its size before and after copying.- Parameters:
source- The source file path.target- The target file path.- Returns:
- True if the file sizes match, false otherwise.
- Throws:
IOException- If an I/O error occurs.
-