|
70 | 70 | */
|
71 | 71 | public class ExistRepository extends Observable implements BrokerPoolService {
|
72 | 72 |
|
| 73 | + private final static Logger EXIST_LOG = LogManager.getLogger(BrokerPool.class); |
73 | 74 | private final static Logger LOG = LogManager.getLogger(ExistRepository.class);
|
74 | 75 | private static final String EXPATH_REPO_DIR_NAME = "expathrepo";
|
75 | 76 | private static final String LEGACY_DEFAULT_EXPATH_REPO_DIR = "webapp/WEB-INF/" + EXPATH_REPO_DIR_NAME;
|
@@ -98,13 +99,27 @@ public void prepare(final BrokerPool brokerPool) throws BrokerPoolServiceExcepti
|
98 | 99 |
|
99 | 100 | LOG.info("Using directory {} for expath package repository", expathDir.toAbsolutePath().toString());
|
100 | 101 |
|
| 102 | + final FileSystemStorage storage; |
| 103 | + try { |
| 104 | + storage = new FileSystemStorage(expathDir); |
| 105 | + } catch(final PackageException e) { |
| 106 | + throw new BrokerPoolServiceException("Unable to open storage for EXPath Package Repository: " + expathDir.toAbsolutePath(), e); |
| 107 | + } |
| 108 | + storage.setErrorIfNoContentDir(false); |
| 109 | + |
| 110 | + this.myParent = new Repository(storage); |
| 111 | + final List<PackageException> exceptions = this.myParent.init(); |
| 112 | + if (exceptions.size() > 0) { |
| 113 | + EXIST_LOG.warn("It may not have been possible to load all EXPath Packages, see repo.log for details..."); |
| 114 | + for (final PackageException exception : exceptions) { |
| 115 | + LOG.error(exception.getMessage(), exception); |
| 116 | + } |
| 117 | + } |
| 118 | + |
101 | 119 | try {
|
102 |
| - final FileSystemStorage storage = new FileSystemStorage(expathDir); |
103 |
| - storage.setErrorIfNoContentDir(false); |
104 |
| - this.myParent = new Repository(storage); |
105 | 120 | myParent.registerExtension(new ExistPkgExtension());
|
106 | 121 | } catch(final PackageException e) {
|
107 |
| - throw new BrokerPoolServiceException("Unable to prepare EXPath Package Repository: " + expathDir.toAbsolutePath().toString(), e); |
| 122 | + throw new BrokerPoolServiceException("Unable to register EXPath Package Repository extension 'ExistPkgExtension': " + e.getMessage(), e); |
108 | 123 | }
|
109 | 124 | }
|
110 | 125 |
|
|
0 commit comments