Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import android.os.Environment;

import java.io.File;

public class Main {
    public static void deleteCSV() {

        File myDir = new File(Environment.getExternalStorageDirectory() + "/Caffeine_Counter_History");

        deleteRecursive(myDir);

    }

    public static void deleteRecursive(File fileOrDirectory) {

        if (fileOrDirectory.isDirectory())
            for (File child : fileOrDirectory.listFiles())
                deleteRecursive(child);

        fileOrDirectory.delete();

    }
}