Only create standard prototype directories if the application directory
is freshly created, i.e. empty.
This commit is contained in:
parent
e037fa0d19
commit
6ff8401512
1 changed files with 8 additions and 6 deletions
|
@ -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 ();
|
||||
|
|
Loading…
Add table
Reference in a new issue