projects/moments/app/src/main/java/io/v/moments/lib/FileUtil.java
/**
     * Delete the given file, and if it's a directory, delete its contents too.
     */
Delete the given file, and if it's a directory, delete its contents too.
Delete the given file and if it ' s a directory delete its contents too .
public static void rmMinusF(File path) {
        if (!path.exists()) {
            throw new IllegalArgumentException(
                    "non-existent path: " + path.getAbsolutePath());
        }
        File[] contents = path.listFiles();
        if (contents != null) {
            for (File f : contents) {
                rmMinusF(f);
            }
        }
        if (!path.delete()) {
            throw new IllegalStateException(
                    "unable to delete " + path.getAbsolutePath());
        }
    }
public static void rmMinusF ( File path ) { if ( ! path . exists ( ) ) { throw new IllegalArgumentException ( "non-existent path: " + path . getAbsolutePath ( ) ) ; } File [ ] contents = path . listFiles ( ) ; if ( contents != null ) { for ( File f : contents ) { rmMinusF ( f ) ; } } if ( ! path . delete ( ) ) { throw new IllegalStateException ( "unable to delete " + path . getAbsolutePath ( ) ) ; } }
Delete the given file, and if it's a directory, delete its contents too.
Delete the given file and if it ' s a directory delete its contents too .