List of usage examples for io.vertx.core.file FileSystem deleteRecursiveBlocking
@Fluent
FileSystem deleteRecursiveBlocking(String path, boolean recursive);
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); }