Example usage for io.vertx.core.file FileSystem deleteRecursiveBlocking

List of usage examples for io.vertx.core.file FileSystem deleteRecursiveBlocking

Introduction

In this page you can find the example usage for io.vertx.core.file FileSystem deleteRecursiveBlocking.

Prototype

@Fluent
FileSystem deleteRecursiveBlocking(String path, boolean recursive);

Source Link

Document

Blocking version of #deleteRecursive(String,boolean,Handler)

Usage

From source file:io.nitor.api.backend.cache.CacheHandler.java

License:Apache License

public CacheHandler(JsonObject cacheConf, FileSystem fileSystem) {
    dir = Paths.get(cacheConf.getString("cacheDir", "/tmp/backend")).toAbsolutePath();
    this.fileSystem = fileSystem;
    try {/* www.ja  va2  s .c o  m*/
        createDirectories(dir);
        walk(dir, 1).filter(p -> !p.equals(dir))
                .forEach(p -> fileSystem.deleteRecursiveBlocking(p.toString(), true));
    } catch (IOException ex) {
        throw new RuntimeException("Failed to initialize cache directory at " + dir);
    }
    logger.info("Caching responses to " + dir);
}