protected void create() throws DBException
 {
  File medium = getMedium();
  File mpath = getMpath();
  String path = null == mpath ? Manager.DB_NAMES[0] : mpath.getPath();
  if (!medium.exists() && medium.mkdir())
   log().info("Created directory \"" + medium + "\" to store the new bag.");
  File location = new File(medium, path);
  initDb(location);
  db.create();
  File locFile = new File(medium, LOCATOR_PROPERTIES_FILE);
  if (!locFile.exists())
  {
   Properties locator = new Properties();
   locator.setProperty(DEFAULT_LOCATOR_PROPERTY, '@' + path);
   OutputStream locStream = null;
   try
   {
    locStream = new FileOutputStream(locFile);
    locator.store(locStream, "data-bag storage locator");
   }
   catch (IOException e)
   {
    log().log(Level.WARNING,
      "Could not write the database locator to medium " + medium, e);
   }
   finally
   {
    if (null != locStream)
     try
     {
      locStream.close();
     } catch (IOException thrown)
     {
      log().log(Level.FINE, "Error closing " + locFile, thrown);
     }
   }
  }
 }