Skip to content

Commit

Permalink
Merge pull request #233 from owlcollab/issue-232-legocat
Browse files Browse the repository at this point in the history
minimal attempt at fixing #232 (lego catalogs)
  • Loading branch information
kltm authored Jan 18, 2018
2 parents 867ada3 + b2878b1 commit bd8020c
Showing 1 changed file with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -555,13 +555,15 @@ else if (opts.nextEq("--noExitIfLoadFails")) {
// Check to see if the global url has been set.
String url = sortOutSolrURL(globalSolrURL);

// Ensure that legoCatalogs is defined, even is empty.
if( legoCatalogs == null ){
legoCatalogs = new ArrayList<File>();
LOG.warn("Missing lego catalogs...");
}

// Only proceed if our environment was well-defined.
if( legoCatalogs == null || legoFiles == null || legoModelPrefix == null ||
legoCatalogs.isEmpty() || legoFiles.isEmpty() ){
if( legoFiles == null || legoModelPrefix == null || legoFiles.isEmpty() ){
String details = "";
if (legoCatalogs == null || legoCatalogs.isEmpty()) {
details += "Missing catalog";
}
if (legoFiles == null || legoFiles.isEmpty()) {
details += " Missing legoFiles";
}
Expand All @@ -571,10 +573,10 @@ else if (opts.nextEq("--noExitIfLoadFails")) {
LOG.error("Lego environment not well defined--skipping: "+details);
exit(-1);
}else{
LOG.info("Start Loading models, count: "+legoFiles.size());
LOG.warn("Start Loading models, count: "+legoFiles.size());
// Ready the environment for every pass.
ParserWrapper pw = new ParserWrapper();
// Add all of the catalogs.
// Add all of the catalogs; possibly none.
for( File legoCatalog : legoCatalogs ){
pw.addIRIMapper(new CatalogXmlIRIMapper(legoCatalog));
}
Expand Down

0 comments on commit bd8020c

Please sign in to comment.