Java File Delete delete(File current)

Here you can find the source of delete(File current)

Description

delete

License

Open Source License

Declaration

public static boolean delete(File current) 

Method Source Code

//package com.java2s;
/* Copyright (c) 2011 by crossmobile.org
 *
 * CrossMobile is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, version 2.
 *
 * CrossMobile 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 CrossMobile; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 *//*from  www  .  j  a  va2  s .  c  o  m*/

import java.io.File;

public class Main {
    public static boolean delete(File current) {
        boolean status = true;
        if (current.isDirectory())
            for (File sub : current.listFiles())
                status &= delete(sub);
        if (current.exists() && (!current.delete()))
            return false;
        return status;
    }
}

Related

  1. clearFile(String directory)
  2. clearFile(String pFileName)
  3. clearFileOrDir(File file)
  4. delete(File aFile)
  5. delete(File classDir)
  6. delete(File dir)
  7. delete(File dir)
  8. delete(File dir)
  9. delete(File f)