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.util.Log;

public class Main {
    private static String TAG = "DEFAC[Helpers]";

    /**
     * 
     * @param filename
     * @return
     */
    public static long getFileSize(String filename) {
        File file = new File(filename);
        if (!file.exists() || !file.isFile()) {
            Log.e(TAG, "GETFILESIZE: File \"" + filename + "\" doesn\'t exist");
            return -1;
        }
        return (file.length() / 1024);
    }
}