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

com.avito.utils.ExistingDirectoryImpl.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 ExistingDirectoryImpl(dir: File) : ExistingDirectory {

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

    override operator fun plus(path: String): ExistingDirectory =
        ExistingDirectoryImpl(File(dir, path))

    override fun file(name: String): ExistingFile =
        ExistingFileImpl(this, name)

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy