예제 #1
0
 @Override
 public boolean match(ResourceFilterContext context, Resource resource) {
   for (ResourceFilter filter : this.filters) {
     if (filter.match(context, resource)) {
       return true;
     }
   }
   return false;
 }
예제 #2
0
 public FilterResourcesStep build() {
   Preconditions.checkNotNull(filesystem);
   Preconditions.checkNotNull(resourceFilter);
   LOG.info("FilterResourcesStep.Builder: resource filter: %s", resourceFilter);
   Preconditions.checkNotNull(inResDirToOutResDirMap);
   return new FilterResourcesStep(
       filesystem,
       inResDirToOutResDirMap,
       resourceFilter.isEnabled(),
       enableStringWhitelisting,
       whitelistedStringDirs,
       locales,
       DefaultFilteredDirectoryCopier.getInstance(),
       resourceFilter.getDensities(),
       DefaultDrawableFinder.getInstance(),
       resourceFilter.shouldDownscale()
           ? new ImageMagickScaler(filesystem.getRootPath())
           : null);
 }
  @RequestMapping(value = "/resource", method = RequestMethod.GET)
  @ResponseBody
  public Resources getContents(GridSettings settings) {
    List<Content> contents = cmsLiteService.getAllContents();
    List<ResourceDto> resourceDtos = ResourceFilter.filter(settings, contents);

    Collections.sort(resourceDtos, new ResourceComparator(settings));

    return new Resources(settings, resourceDtos);
  }
 @Override
 public boolean visit(final IResource resource) {
   if (resource.exists() && resource.getType() == IResource.FILE && resFilt.accept(resource))
     resources.add(resource);
   return true;
 }