public static void deleteDirectory(File directoryOrFile) { if (!directoryOrFile.exists()) { return; } if (directoryOrFile.isDirectory()) { for (File child : directoryOrFile.listFiles()) { deleteDirectory(child); } } directoryOrFile.delete(); }
public static void cleanupAllAttachments() { Utility.deleteDirectory(getAttachmentsDirectory()); }
public static void cleanupAttachmentsForCall(UUID uuid) { File attachmentsDirectoryForCall = getAttachmentsDirectoryForCall(uuid, false); if (attachmentsDirectoryForCall != null) { Utility.deleteDirectory(attachmentsDirectoryForCall); } }