I am creating a function in Databricks to check if folder exists in Azure Blob Storage:
import java.io.File
def checkFolder(paths: List[String]): Unit = {
for (f <- paths) {
try
{
var pathCheck = dbutils.fs.ls(f)
}
catch {
case ex: Exception => {
println("Folder does not exists: " + f)
}
}
}
}
I want to add the folders that exists in list so that I can read the data in those paths! I also want to add the path that do not exist in a different list.
How would I do that?