File modelFolder = new File(_parentFolder, myName + ".eomodeld");
File modelFolder; if (_parentFolder.getName().endsWith(".eomodeld")) { modelFolder = _parentFolder; } else { modelFolder = new File(_parentFolder, myName + ".eomodeld"); }
  public void saveToFolder(File _parentFolder) throws IOException {    File modelFolder = new File(_parentFolder, myName + ".eomodeld"); //$NON-NLS-1$    if (!modelFolder.exists()) {      if (!modelFolder.mkdirs()) {        throw new IOException("Failed to create folder '" + modelFolder + "'.");      }    }    File indexFile = new File(modelFolder, "index.eomodeld"); //$NON-NLS-1$    EOModelMap modelMap = toMap();    PropertyListSerialization.propertyListToFile(indexFile, modelMap);    if (myDeletedEntityNamesInObjectStore != null) {      Iterator deletedEntityNameIter = myDeletedEntityNamesInObjectStore.iterator();      while (deletedEntityNameIter.hasNext()) {        String entityName = (String) deletedEntityNameIter.next();        File entityFile = new File(modelFolder, entityName + ".plist"); //$NON-NLS-1$        entityFile.delete();        File fspecFile = new File(modelFolder, entityName + ".fspec"); //$NON-NLS-1$        fspecFile.delete();      }    }    Iterator entitiesIter = myEntities.iterator();    while (entitiesIter.hasNext()) {      EOEntity entity = (EOEntity) entitiesIter.next();      String entityName = entity.getName();      File entityFile = new File(modelFolder, entityName + ".plist"); //$NON-NLS-1$      File fspecFile = new File(modelFolder, entityName + ".fspec"); //$NON-NLS-1$      entity.saveToFile(entityFile, fspecFile);    }  }