Only create standard prototype directories if the application directory

is freshly created, i.e. empty.
This commit is contained in:
hns 2001-09-08 17:45:53 +00:00
parent e037fa0d19
commit 6ff8401512

View file

@ -46,6 +46,7 @@ public class TypeManager implements Runnable {
this.app = app; this.app = app;
appDir = app.appDir; appDir = app.appDir;
// make sure the directories for the standard prototypes exist, and lament otherwise // make sure the directories for the standard prototypes exist, and lament otherwise
if (appDir.list().length == 0) {
for (Iterator it=standardTypes.iterator (); it.hasNext (); ) { for (Iterator it=standardTypes.iterator (); it.hasNext (); ) {
File f = new File (appDir, (String) it.next ()); File f = new File (appDir, (String) it.next ());
if (!f.exists() && !f.mkdir ()) if (!f.exists() && !f.mkdir ())
@ -53,6 +54,7 @@ public class TypeManager implements Runnable {
else if (!f.isDirectory ()) else if (!f.isDirectory ())
app.logEvent ("Warning: "+f.getAbsolutePath ()+" is not a directory."); app.logEvent ("Warning: "+f.getAbsolutePath ()+" is not a directory.");
} }
}
prototypes = new HashMap (); prototypes = new HashMap ();
zipfiles = new HashMap (); zipfiles = new HashMap ();
registeredEvaluators = Collections.synchronizedList (new ArrayList (30)); registeredEvaluators = Collections.synchronizedList (new ArrayList (30));