Java tutorial
//package com.java2s; import java.io.File; public class Main { public static void deleteFile(String imageLocation) { if (imageLocation != null && imageLocation.trim().length() > 5) { File file = new File(imageLocation); if (file.exists()) { boolean fi = file.delete(); } } } }