All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.avito.utils.ExistingFileImpl.kt Maven / Gradle / Ivy

Go to download

Collection of infrastructure libraries and gradle plugins of Avito Android project

There is a newer version: 2023.22
Show newest version
package com.avito.utils

import java.io.File

public class ExistingFileImpl(file: File) : ExistingFile {

    override val file: File = file
        get() {
            require(field.exists()) { "${field.path} must exists" }
            require(field.isFile) { "${field.path} must be a file" }
            return field
        }

    public constructor(directory: ExistingDirectory, fileName: String) : this(
        File(
            directory.dir,
            fileName
        )
    )

    override fun toString(): String = file.toString()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy