Skip to content

Instantly share code, notes, and snippets.

@Ryan-ZA
Ryan-ZA / 1. StaticFileHandler.java
Last active January 13, 2018 04:01
Simple static fileserver for vert.x - uses cached SHA1 hash etags for client caching to ensure that cached files remain correct after redeploys and between servers.
package com.rc;
import java.nio.file.FileSystems;
import java.nio.file.Path;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import org.vertx.java.core.AsyncResult;
import org.vertx.java.core.Handler;
import org.vertx.java.core.Vertx;