Made per-context storage roots a Tomcat-specific function.
authorFredrik Tolf <fredrik@dolda2000.com>
Wed, 27 Jan 2010 00:39:37 +0000 (01:39 +0100)
committerFredrik Tolf <fredrik@dolda2000.com>
Wed, 27 Jan 2010 00:39:37 +0000 (01:39 +0100)
src/dolda/jsvc/j2ee/TomcatContext.java
src/dolda/jsvc/store/FileStore.java

index 8672d39..db53550 100644 (file)
@@ -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"));
index 55c15d7..31abd5e 100644 (file)
@@ -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)));
                }
            });
     }