Created
June 1, 2012 13:54
-
-
Save dph01/2852336 to your computer and use it in GitHub Desktop.
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
val contextPath = LiftRules.context match { | |
case c: HTTPServletContext => Full(c.path) | |
case _ => Empty | |
} | |
info("Context Path is: " + contextPath ) | |
val jettyResourceDir = Box.!!(System.getProperty("jetty.resource.dir")) | |
info("got jetty.resource.dir from system properties: " + jettyResourceDir) | |
val whereToLook = jettyResourceDir.flatMap( dir => { | |
contextPath.map( cp => | |
for ( | |
propsname <- Props.toTry; | |
fullname = dir + cp + propsname() + "props"; | |
file = new File(fullname); | |
if (file.exists) | |
) yield fullname -> { () => Full(new FileInputStream(file))} | |
) | |
}) | |
whereToLook.foreach( w => | |
Props.whereToLook = () => w ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment