package com.reactlibrary;

/**
 *
 */


import android.content.Context;

import java.io.File;
import java.util.Date;

public class ImageFileUtil {

    public static String imageType = "image/png";

    public static File getSaveFile(Context context,String fileName) {
        File file = new File(context.getFilesDir(), fileName);
        return file;
    }

    public static File getSaveFile(Context context) {
        File file = new File(context.getFilesDir(), "pic.png");
        return file;
    }

    public static int getSecondTimestamp(Date date){
        if (null == date) {
            return 0;
        }
        String timestamp = String.valueOf(date.getTime());
        int length = timestamp.length();
        if (length > 3) {
            return Integer.valueOf(timestamp.substring(0,length-3));
        } else {
            return 0;
        }
    }
}
