Java File Path Delete deleteFolder(String pFolderPath)

Here you can find the source of deleteFolder(String pFolderPath)

Description

delete Folder

License

Open Source License

Declaration

public static void deleteFolder(String pFolderPath) 

Method Source Code

//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();
    }
}

Related

  1. deleteFolder(String path)
  2. deleteFolder(String path)
  3. deleteFolder(String path)
  4. deleteFolder(String path)
  5. deleteFolder(String pathToRootFolder)
  6. deleteFolder(String sPath)
  7. deleteFolderAndContent(String folderPath)
  8. deleteFolderRec(File path, boolean alsoDeleteGivenFolder)
  9. deleteFolderRecursively(File path, boolean includeSelf)