From 67fe85aafa08a3b3081218d698ae166b35d5bc95 Mon Sep 17 00:00:00 2001 From: Fredrik Tolf Date: Wed, 27 Jan 2010 01:39:37 +0100 Subject: [PATCH] Made per-context storage roots a Tomcat-specific function. --- src/dolda/jsvc/j2ee/TomcatContext.java | 5 ++++- src/dolda/jsvc/store/FileStore.java | 8 +------- 2 files changed, 5 insertions(+), 8 deletions(-) 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))); } }); } -- 2.11.0