Cleaned up code for generating standard prototype directories, and issue

a warning if one could not be created or is something else than a directory.
This commit is contained in:
hns 2001-04-19 13:14:38 +00:00
parent ce51acc353
commit 0eaf74102b

View file

@ -49,18 +49,14 @@ public class TypeManager implements Runnable {
public TypeManager (Application app) { public TypeManager (Application app) {
this.app = app; this.app = app;
appDir = app.appDir; appDir = app.appDir;
File f = new File (appDir, "user"); // make sure the directories for the standard prototypes exist, and lament otherwise
if (!f.exists()) for (Iterator it=standardTypes.iterator (); it.hasNext (); ) {
f.mkdir (); File f = new File (appDir, (String) it.next ());
f = new File (appDir, "root"); if (!f.exists() && !f.mkdir ())
if (!f.exists()) app.logEvent ("Warning: directory "+f.getAbsolutePath ()+" could not be created.");
f.mkdir (); else if (!f.isDirectory ())
f = new File (appDir, "global"); app.logEvent ("Warning: "+f.getAbsolutePath ()+" is not a directory.");
if (!f.exists()) }
f.mkdir ();
f = new File (appDir, "hopobject");
if (!f.exists())
f.mkdir ();
prototypes = new HashMap (); prototypes = new HashMap ();
zipfiles = new HashMap (); zipfiles = new HashMap ();
registeredEvaluators = Collections.synchronizedList (new ArrayList (30)); registeredEvaluators = Collections.synchronizedList (new ArrayList (30));