예제 #1
0
  /**
   * Get CatalogResolver.
   *
   * @return CatalogResolver
   */
  public static synchronized CatalogResolver getCatalogResolver() {
    if (catalogResolver == null) {
      final CatalogManager manager = new CatalogManager();
      manager.setIgnoreMissingProperties(true);
      manager.setUseStaticCatalog(false); // We'll use a private catalog.
      manager.setPreferPublic(true);

      // manager.setVerbosity(10);
      catalogResolver = new CatalogResolver(manager);

      final File catalogFilePath = new File(ditaDir, FILE_NAME_CATALOG);

      final Catalog catalog = catalogResolver.getCatalog();
      try {
        catalog.parseCatalog(catalogFilePath.toURI().toURL());
      } catch (final Exception e) {
        logger.logException(e);
      }
    }

    return catalogResolver;
  }
 private CatalogManager configureCatalogManager(String catalogFilePath)
     throws ConfigurationResourceAccessException {
   CatalogManager catalogManager = new CatalogManager();
   catalogManager.setRelativeCatalogs(false);
   catalogManager.setPreferPublic(true);
   catalogManager.setUseStaticCatalog(false);
   catalogManager.setAllowOasisXMLCatalogPI(true);
   if (isNotEmpty(catalogFilePath)) {
     catalogManager.setCatalogFiles(resolvePath(catalogFilePath));
   }
   return catalogManager;
 }