架构

spring项目结构设计-文件工具类

2020-05-13  本文已影响0人  jinelei
object FileUtils {

    @Throws(exceptionClasses = [BasicException::class])
    fun extraLastModified(file: File): Instant {
        val lastModified = file.lastModified()
        if (lastModified == 0L)
            throw BasicException(BasicError.FILE_NOT_EXIST, "destination file ${file.name} not exist")
        return Instant.ofEpochMilli(lastModified)
    }

}
上一篇 下一篇

猜你喜欢

热点阅读