docs: public static DocumentStore getInstance(File location, KeyProvider provider) throws DocumentStoreNotOpenedException {
          try {
              synchronized (documentStores) {
                  DocumentStore ds = documentStores.get(location);
                  // See if the file exists already, so we can raise the right event.
                  // SQLDatabaseFactory.openOrCreateSQLDatabase will create directories and file if
                  // required.
                  boolean created = !location.exists();
                  if (ds == null) {
                      ds = new DocumentStore(location, provider);
                      documentStores.put(location, ds);
                      if (created) {
                          eventBus.post(new DocumentStoreCreated(ds.databaseName));
                      }
                      eventBus.post(new DocumentStoreOpened(ds.databaseName));
                  }
                  return ds;
              }
          }
          catch (IOException e) {
              throw new DocumentStoreNotOpenedException("Database not found: " + location, e);
          } catch (SQLException e) {
              // thrown during schema upgrades, etc
              throw new DocumentStoreNotOpenedException("Database not initialized correctly: " + location, e);
          } catch (IllegalArgumentException e) {
              // thrown by SQLDatabaseFactory if directory is not writable
              throw new DocumentStoreNotOpenedException("Database location not accessible: " + location, e);
          } catch (DocumentStoreNotOpenedException e) {
              throw e;
          } catch (DocumentStoreException e) {
              throw new DocumentStoreNotOpenedException("Datastore not initialized correctly: " + location, e);
          }
      }