Project

General

Profile

Revision 7808

do not attempt to copy solr-home template from metacat-index webapp if it does not exist. This would be in cases where metacat-index is not deployed. https://projects.ecoinformatics.org/ecoinfo/issues/6006

View differences:

src/edu/ucsb/nceas/metacat/admin/PropertiesAdmin.java
266 266
						FileUtil.createDirectory(solrHomePath);
267 267
						String metacatWebInf = ServiceService.getRealConfigDir();
268 268
						String metacatIndexSolrHome = metacatWebInf + "/../../" + indexContext + "/WEB-INF/classes/solr-home";
269
						OrFileFilter fileFilter = new OrFileFilter();
270
						fileFilter.addFileFilter(DirectoryFileFilter.DIRECTORY);
271
						fileFilter.addFileFilter(new WildcardFileFilter("*"));
272
						FileUtils.copyDirectory(new File(metacatIndexSolrHome), new File(solrHomePath), fileFilter );
269
						// only attempt to copy if we have the source directory to copy from
270
						File sourceDir = new File(metacatIndexSolrHome);
271
						if (sourceDir.exists()) {
272
							OrFileFilter fileFilter = new OrFileFilter();
273
							fileFilter.addFileFilter(DirectoryFileFilter.DIRECTORY);
274
							fileFilter.addFileFilter(new WildcardFileFilter("*"));
275
							FileUtils.copyDirectory(new File(metacatIndexSolrHome), new File(solrHomePath), fileFilter );
276
						}
273 277
					} catch (Exception ue) {	
274 278
						String errorString = "PropertiesAdmin.configureProperties - Could not initialize directory: " + solrHomePath +
275 279
								" : " + ue.getMessage();

Also available in: Unified diff