public Void apply(final Collection<File> files) { if (baseNameFolder == null) { // replacing group with empty list since the original uri has no associated resources. // No BaseNameFolder found LOG.warn("The resource {} is probably invalid, removing it from the group.", resource); group.replace(resource, new ArrayList<Resource>()); } else { final List<Resource> expandedResources = new ArrayList<Resource>(); LOG.debug("baseNameFolder: {}", baseNameFolder); for (final File file : files) { final String resourcePath = getFullPathNoEndSeparator(resource); LOG.debug("\tresourcePath: {}", resourcePath); LOG.debug("\tfile path: {}", file.getPath()); final String computedResourceUri = resourcePath + StringUtils.removeStart(file.getPath(), baseNameFolder).replace('\\', '/'); final Resource expandedResource = Resource.create(computedResourceUri, resource.getType()); LOG.debug("\texpanded resource: {}", expandedResource); expandedResources.add(expandedResource); } LOG.debug("\treplace resource {}", resource); group.replace(resource, expandedResources); } return null; }
public Void apply(final Collection<File> files) { if (baseNameFolder == null) { // replacing group with empty list since the original uri has no associated resources. // No BaseNameFolder found LOG.warn("The resource {} is probably invalid, removing it from the group.", resource); group.replace(resource, new ArrayList<Resource>()); } else { final List<Resource> expandedResources = new ArrayList<Resource>(); LOG.debug("baseNameFolder: {}", baseNameFolder); for (final File file : files) { final String resourcePath = getFullPathNoEndSeparator(resource); LOG.debug("\tresourcePath: {}", resourcePath); LOG.debug("\tfile path: {}", file.getPath()); final String computedResourceUri = resourcePath + StringUtils.removeStart(file.getPath(), baseNameFolder).replace('\\', '/'); final Resource expandedResource = Resource.create(computedResourceUri, resource.getType()); LOG.debug("\texpanded resource: {}", expandedResource); expandedResources.add(expandedResource); } LOG.debug("\treplace resource {}", resource); group.replace(resource, expandedResources); } return null; }