From 6ff840151263f4efd8b9133e1714ece4fa2642a1 Mon Sep 17 00:00:00 2001 From: hns Date: Sat, 8 Sep 2001 17:45:53 +0000 Subject: [PATCH] Only create standard prototype directories if the application directory is freshly created, i.e. empty. --- src/helma/framework/core/TypeManager.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/helma/framework/core/TypeManager.java b/src/helma/framework/core/TypeManager.java index 642fa84d..97e5c713 100644 --- a/src/helma/framework/core/TypeManager.java +++ b/src/helma/framework/core/TypeManager.java @@ -46,12 +46,14 @@ public class TypeManager implements Runnable { this.app = app; appDir = app.appDir; // make sure the directories for the standard prototypes exist, and lament otherwise - for (Iterator it=standardTypes.iterator (); it.hasNext (); ) { - File f = new File (appDir, (String) it.next ()); - if (!f.exists() && !f.mkdir ()) - app.logEvent ("Warning: directory "+f.getAbsolutePath ()+" could not be created."); - else if (!f.isDirectory ()) - app.logEvent ("Warning: "+f.getAbsolutePath ()+" is not a directory."); + if (appDir.list().length == 0) { + for (Iterator it=standardTypes.iterator (); it.hasNext (); ) { + File f = new File (appDir, (String) it.next ()); + if (!f.exists() && !f.mkdir ()) + app.logEvent ("Warning: directory "+f.getAbsolutePath ()+" could not be created."); + else if (!f.isDirectory ()) + app.logEvent ("Warning: "+f.getAbsolutePath ()+" is not a directory."); + } } prototypes = new HashMap (); zipfiles = new HashMap ();