Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.io.File;

import android.content.Context;

public class Main {
    /**
     * Removes entities file.
     * @param context
     * @param fileName
     * @throws Exception 
     */
    public static void removeAllEntities(Context context, String fileName) throws Exception {
        File file = new File(context.getFilesDir(), fileName);
        boolean deleted = file.delete();
        if (!deleted) {
            throw new Exception("Failed to remove file=" + fileName);
        }
    }
}