美文网首页架构
spring项目结构设计-文件工具类

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

作者: jinelei | 来源:发表于2020-05-13 17:34 被阅读0次
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)
    }

}

相关文章

网友评论

    本文标题:spring项目结构设计-文件工具类

    本文链接:https://www.haomeiwen.com/subject/cjkonhtx.html