Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.io.File;

public class Main {

    public static void deleteCache(File cacheDir) {
        try {

            File[] files = cacheDir.listFiles();

            for (int i = 0; i < files.length; i++) {
                if (files[i].isFile()) {
                    files[i].delete();
                }
                if (files[i].isDirectory()) {
                    deleteCache(files[i]);
                }
            }
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }
}