Skip to content

Instantly share code, notes, and snippets.

@dph01
Created June 1, 2012 13:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dph01/2852328 to your computer and use it in GitHub Desktop.
Save dph01/2852328 to your computer and use it in GitHub Desktop.
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