package com.miya.fastcashier.util.manage.log

import java.io.File
import java.io.FileFilter

class LFileFilter(private val mTypes: Array<String>?) : FileFilter {

    override fun accept(file: File): Boolean {
        if (file.isDirectory) {
            return true
        }
        if (mTypes != null && mTypes.size > 0) {
            for (i in mTypes.indices) {
                if (file.name.endsWith(mTypes[i].toLowerCase()) || file.name.endsWith(mTypes[i].toUpperCase())) {
                    return true
                }
            }
        } else {
            return true
        }
        return false
    }
}