Here you can find the source of removeFile(String absPath)
Parameter | Description |
---|---|
absPath | a parameter |
public static Boolean removeFile(String absPath)
//package com.java2s; import java.io.File; public class Main { /**// w w w. j av a 2 s . c o m * Xoa 1 file khoi he thong * * @param absPath * @return */ public static Boolean removeFile(String absPath) { if (absPath == null || absPath.equals("")) { return false; } File f = new File(absPath); if (f.isFile()) { return f.delete(); } return false; } /** * Delete File or Folder recursively * * @param root * @return */ public static Boolean delete(String root) { if (root == null) { return false; } File f = new File(root); if (f.isDirectory()) { for (File tmp : f.listFiles()) { delete(tmp.getAbsolutePath()); } } return f.delete(); } }