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,12 +46,14 @@ 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
for (Iterator it=standardTypes.iterator (); it.hasNext (); ) { if (appDir.list().length == 0) {
File f = new File (appDir, (String) it.next ()); for (Iterator it=standardTypes.iterator (); it.hasNext (); ) {
if (!f.exists() && !f.mkdir ()) File f = new File (appDir, (String) it.next ());
app.logEvent ("Warning: directory "+f.getAbsolutePath ()+" could not be created."); if (!f.exists() && !f.mkdir ())
else if (!f.isDirectory ()) app.logEvent ("Warning: directory "+f.getAbsolutePath ()+" could not be created.");
app.logEvent ("Warning: "+f.getAbsolutePath ()+" is not a directory."); else if (!f.isDirectory ())
app.logEvent ("Warning: "+f.getAbsolutePath ()+" is not a directory.");
}
} }
prototypes = new HashMap (); prototypes = new HashMap ();
zipfiles = new HashMap (); zipfiles = new HashMap ();