/** * Gets the paths that are chosen to be indexed by the user. * * @return the included paths. */ public Collection<Index> getIndexes() { if (this.indexes == null) { this.indexes = this.getIndexCollection(); if (this.indexes == null) { this.indexes = new ArrayList<Index>(); } } return this.indexes; }
IncludedPath includedPath = new IncludedPath(); includedPath.setPath(IndexingPolicy.DEFAULT_PATH); includedPath.setIndexes(new ArrayList<Index>(Arrays.asList(defaultIndexOverrides))); this.getIncludedPaths().add(includedPath);
@Override void populatePropertyBag() { // If indexing mode is not 'none' and not paths are set, set them to the defaults if (this.getIndexingMode() != IndexingMode.None && this.getIncludedPaths().size() == 0 && this.getExcludedPaths().size() == 0) { IncludedPath includedPath = new IncludedPath(); includedPath.setPath(IndexingPolicy.DEFAULT_PATH); this.getIncludedPaths().add(includedPath); } if (this.includedPaths != null) { for (IncludedPath includedPath : this.includedPaths) { includedPath.populatePropertyBag(); } super.set(Constants.Properties.INCLUDED_PATHS, this.includedPaths); } if (this.excludedPaths != null) { for (ExcludedPath excludedPath : this.excludedPaths) { excludedPath.populatePropertyBag(); } super.set(Constants.Properties.EXCLUDED_PATHS, this.excludedPaths); } } }
private Collection<IncludedPath> getIndexingPolicyIncludePaths(Class<?> domainClass) { final Collection<IncludedPath> pathsCollection = new ArrayList<>(); final DocumentIndexingPolicy annotation = domainClass.getAnnotation(DocumentIndexingPolicy.class); if (annotation == null || annotation.includePaths() == null || annotation.includePaths().length == 0) { return null; // Align the default value of IndexingPolicy } final String[] rawPaths = annotation.includePaths(); for (final String path : rawPaths) { pathsCollection.add(new IncludedPath(path)); } return pathsCollection; }
private Collection<IncludedPath> getIndexingPolicyIncludePaths(Class<?> domainClass) { final Collection<IncludedPath> pathsCollection = new ArrayList<>(); final DocumentIndexingPolicy annotation = domainClass.getAnnotation(DocumentIndexingPolicy.class); if (annotation == null || annotation.includePaths() == null || annotation.includePaths().length == 0) { return null; // Align the default value of IndexingPolicy } final String[] rawPaths = annotation.includePaths(); for (final String path : rawPaths) { pathsCollection.add(new IncludedPath(path)); } return pathsCollection; }