From 9c3cbea82f620d51561087a310b779ffa16643f4 Mon Sep 17 00:00:00 2001 From: hns Date: Fri, 5 Jul 2002 15:05:10 +0000 Subject: [PATCH] Provide a variant of the updatePrototype() method that takes a prototype object instead of the prototype name. --- src/helma/framework/core/TypeManager.java | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/helma/framework/core/TypeManager.java b/src/helma/framework/core/TypeManager.java index 4bc5f96a..cc9846a6 100644 --- a/src/helma/framework/core/TypeManager.java +++ b/src/helma/framework/core/TypeManager.java @@ -174,11 +174,19 @@ public final class TypeManager { /** - * Update a prototype based on the directory which defines it. + * Update a prototype to the files in the prototype directory. */ public void updatePrototype (String name) { // System.err.println ("UPDATE PROTO: "+app.getName()+"/"+name); Prototype proto = getPrototype (name); + updatePrototype (proto); + } + + /** + * Update a prototype to the files in the prototype directory. + */ + public void updatePrototype (Prototype proto) { + if (proto == null) return; if (System.currentTimeMillis() - proto.getLastCheck() < 1000) @@ -188,7 +196,7 @@ public final class TypeManager { if (System.currentTimeMillis() - proto.getLastCheck() < 1000) return; - File dir = new File (appDir, name); + File dir = new File (appDir, proto.getName()); boolean needsUpdate = false; HashSet updatables = null; @@ -295,9 +303,9 @@ public final class TypeManager { upd.update (); } catch (Exception x) { if (upd instanceof DbMapping) - app.logEvent ("Error updating db mapping for type "+name+": "+x); + app.logEvent ("Error updating db mapping for type "+proto.getName()+": "+x); else - app.logEvent ("Error updating "+upd+" of prototye type "+name+": "+x); + app.logEvent ("Error updating "+upd+" of prototye type "+proto.getName()+": "+x); } } }