public void importToDB() throws Exception { CertStoreType certstore; try { @SuppressWarnings("unchecked") JAXBElement<CertStoreType> root = (JAXBElement<CertStoreType>) unmarshaller.unmarshal(new File(baseDir + File.separator + FILENAME_OCSP_CertStore)); certstore = root.getValue(); } catch (JAXBException e) { throw XMLUtil.convert(e); } if (certstore.getVersion() > VERSION) { throw new Exception( "could not import CertStore greater than " + VERSION + ": " + certstore.getVersion()); } File processLogFile = new File(baseDir, DbPorter.IMPORT_PROCESS_LOG_FILENAME); System.out.println("importing OCSP certstore to database"); try { if (!resume) { dropIndexes(); import_issuer(certstore.getIssuers()); } import_cert(certstore, processLogFile); recoverIndexes(); processLogFile.delete(); } catch (Exception e) { System.err.println("error while importing OCSP certstore to database"); throw e; } System.out.println(" imported OCSP certstore to database"); } // method importToDB