Here you can find the source of deleteFolder(String pFolderPath)
public static void deleteFolder(String pFolderPath)
//package com.java2s; /**//ww w . j a v a2s . c o m * Copyright (c) 2014 Dung Ta Van. All rights reserved. * * This file is part of GameViewSdk. * GameViewSdk is free library: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * GameViewSdk is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with GameViewSdk. If not, see <http://www.gnu.org/licenses/>. */ import java.io.File; public class Main { public static void deleteFolder(String pFolderPath) { File file = new File(pFolderPath); file.delete(); for (int i = 0; file != null && file.isDirectory() && i < file.listFiles().length; i++) { deleteFolder(file.listFiles()[i].getAbsolutePath()); file.delete(); } file.delete(); } }