java - Scala Lift - Save files to directory in apache -
i have ajax file upload system , running.
what i'm trying store files in directory under apache's webroot, app running in tomcat , i'd prefer storing files outside of webroot (in tomcat), , inside webroot of apache somewhere, regulary update app.
i've got this:
var root = new java.io.file("").getabsolutepath()
which can give me apps location.
i don't want have add config.xml app, wondering if out there knew how find location of apache's webroot in event changes or swap servers , setup different?
wow typed "webroot" alot..
thanks alot help, appreciated :)
finding current apache location tricky business, specially if need deal virtual hosts. should using property files that. can have multiple props files, 1 each environment.
lift has many ways load property files, highly recommend finding solution using it. instance, can override config file in lift.
alternatively, can have apache home set variable in jetty startup script, like:
java_options="$java_options -dapache.home=/etc/httpd"
and use in code:
val apachehome = system.getproperty("apache.home")
beware system.getproperty returns null if such property not exists. might want use option
, making check more idiomatic:
val apachehome = option(system.getproperty("apache.home")) // apachehome: option[java.lang.string] = ...
Comments
Post a Comment