package com.naz.sdkdemo.utils; import java.io.File; public class FileHelper { public static boolean deleteImageFile(String imagePath) { File file = new File(imagePath); // 检查文件是否存在和是否是文件 if (file.exists() && file.isFile()) { return file.delete(); } return false; } }