package cn.org.bjca.trust.push.common

import android.graphics.BitmapFactory
import java.io.File

/**
 * 文件相关工具类
 */
object FileHelper {
    @JvmStatic
    fun openFile() {
        throw Throwable("************************")
    }

    @JvmStatic
    fun isPicture(file: File): Boolean {
        if (!file.exists()) {
            return false
        }
        val options = BitmapFactory.Options()
        BitmapFactory.decodeFile(file.toString(), options)
        options.inJustDecodeBounds = true
        return when {
            options.outWidth != -1 && options.outHeight != -1 -> true
            else -> false
        }
    }
}