This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PropsLoader(val filePath:String, val defaults:Map[String, String] = Map(), val reloadSecs:Int = 5) { | |
import java.util.concurrent.atomic._ | |
private val file = new java.io.File(filePath) | |
if (!file.isFile) throw new IllegalArgumentException(s"'$filePath' at ${file.getAbsolutePath} is not a file") | |
private var javaProps = new java.util.Properties | |
@volatile //synchronizes, could add thread-local cache | |
private var props = defaults | |
private val lastLoadCheck = new AtomicLong(-1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package x | |
import unfiltered.request._ | |
import unfiltered.response._ | |
import unfiltered.Cookie | |
import unfiltered.filter._ | |
import javax.servlet.{Filter, FilterConfig, FilterChain, ServletRequest, ServletResponse} | |
import javax.servlet.http.{HttpServletRequest, HttpServletResponse, HttpServletRequestWrapper} | |
import java.security.Principal |