public void installCatalogDB(String secretKey, String password) throws CatalogException {
if (existsCatalogDB()) {
throw new CatalogException("Nothing to install. There already exists a catalog database");
}
ParamUtils.checkParameter(secretKey, "secretKey");
ParamUtils.checkParameter(password, "password");
configuration.getAdmin().setPassword(password);
configuration.getAdmin().setSecretKey(secretKey);
URI jobsURI;
try {
jobsURI = UriUtils.createDirectoryUri(configuration.getTempJobsDir());
} catch (URISyntaxException e) {
throw new CatalogException("Failed to create a directory URI from " + configuration.getTempJobsDir());
}
CatalogIOManager ioManager = getCatalogIOManagerFactory().get(jobsURI);
if (!ioManager.isDirectory(jobsURI) || CollectionUtils.isNotEmpty(ioManager.listFiles(jobsURI))) {
throw new CatalogException("Cannot install openCGA. Jobs folder is not empty.\nPlease, empty it first.");
}
catalogDBAdaptorFactory.installCatalogDB(configuration);
}