From: Fredrik Tolf Date: Wed, 27 Jan 2010 00:39:37 +0000 (+0100) Subject: Made per-context storage roots a Tomcat-specific function. X-Git-Url: http://git.dolda2000.com/gitweb/?a=commitdiff_plain;h=67fe85aafa08a3b3081218d698ae166b35d5bc95;p=jsvc.git Made per-context storage roots a Tomcat-specific function. --- diff --git a/src/dolda/jsvc/j2ee/TomcatContext.java b/src/dolda/jsvc/j2ee/TomcatContext.java index 8672d39..db53550 100644 --- a/src/dolda/jsvc/j2ee/TomcatContext.java +++ b/src/dolda/jsvc/j2ee/TomcatContext.java @@ -58,7 +58,10 @@ public class TomcatContext extends J2eeContext { logger.log(Level.WARNING, "no permissions to fetch Tomcat base directory while reading configuration", e); return; } - sysconfig.put("jsvc.storage", "file:" + new File(new File(base, "work"), "jsvc").getPath()); + File sroot = new File(new File(base, "work"), "jsvc"); + if(name != null) + sroot = new File(sroot, name()); + sysconfig.put("jsvc.storage", "file:" + sroot.getPath()); File cdir = new File(base, "conf"); try { loadprops(sysconfig, new File(cdir, "jsvc.properties")); diff --git a/src/dolda/jsvc/store/FileStore.java b/src/dolda/jsvc/store/FileStore.java index 55c15d7..31abd5e 100644 --- a/src/dolda/jsvc/store/FileStore.java +++ b/src/dolda/jsvc/store/FileStore.java @@ -238,13 +238,7 @@ class FileStore extends Store { public static void register() { Store.register("file", new Factory() { public Store create(String rootname, Package pkg) { - java.io.File root = new java.io.File(rootname); - ThreadContext ctx = ThreadContext.current(); - if(ctx != null) { - if(ctx.server().name() != null) - root = new java.io.File(root, ctx.server().name()); - } - return(new FileStore(pkg, root)); + return(new FileStore(pkg, new java.io.File(rootname))); } }); }