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

com.avito.utils.Path.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 androidx.annotation.RequiresApi
import com.avito.android.Result
import java.nio.file.Path

@RequiresApi(api = 26)
public fun Path.deleteRecursively(): Result {
    return Result.tryCatch {
        val isDeleted = toFile().deleteRecursively()
        if (!isDeleted) {
            throw IllegalStateException("not cleared, reason unknown because of java.io.File API")
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy