Skip to content

Commit

Permalink
Use cache by default (see #159).
Browse files Browse the repository at this point in the history
  • Loading branch information
angelozerr committed Oct 29, 2018
1 parent 6055aef commit 8a5444e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ public static ContentModelManager getInstance() {
private final XMLFileAssociationResolverExtension fileAssociationResolver;

public ContentModelManager() {
cmDocumentCache = new HashMap<>();
cmDocumentCache = new HashMap<>();
URIResolverExtensionManager resolverManager = URIResolverExtensionManager.getInstance();
loader = new XSLoaderImpl();
loader.setParameter("http://apache.org/xml/properties/internal/entity-resolver", resolverManager);
loader.setParameter(Constants.DOM_ERROR_HANDLER, new DOMErrorHandler() {

@Override
public boolean handleError(DOMError error) {
if (error.getRelatedException() instanceof CacheResourceDownloadingException) {
Expand All @@ -75,6 +75,8 @@ public boolean handleError(DOMError error) {
resolverManager.registerResolver(fileAssociationResolver);
catalogResolverExtension = new XMLCatalogResolverExtension();
resolverManager.registerResolver(catalogResolverExtension);
// Use cache by default
setUseCache(true);
}

public CMElementDeclaration findCMElement(Element element) throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@ public class ContentModelSettings {

private XMLFileAssociation[] fileAssociations;

public ContentModelSettings() {
// Use cache by default
setUseCache(true);
}

/**
* Returns true if cache to download XML Schema, DTD must be activated and false
* otherwise.
Expand Down

0 comments on commit 8a5444e

Please sign in to comment.