/** * Filters this list of resource names to only include the ones whose filename matches this prefix and this suffix. */ private Set<String> filterResourceNames(Set<String> resourceNames, ResourceFilter predicate) { Set<String> filteredResourceNames = new TreeSet<String>(); for (String resourceName : resourceNames) { if (predicate.isMatch(resourceName)) { filteredResourceNames.add(resourceName); } } return filteredResourceNames; } }
/** * Filters this list of resource names to only include the ones whose filename matches this prefix and this suffix. */ private Set<String> filterResourceNames(Set<String> resourceNames, ResourceFilter predicate) { Set<String> filteredResourceNames = new TreeSet<String>(); for (String resourceName : resourceNames) { if (predicate.isMatch(resourceName)) { filteredResourceNames.add(resourceName); } } return filteredResourceNames; } }
public List<Resource> scanForResources(Location location, ResourceFilter predicate) { try { List<Resource> resources = new ArrayList<Resource>(); String path = location.getPath(); for (String asset : context.getAssets().list(path)) { if (predicate.isMatch(asset)) { resources.add(new AndroidResource(context.getAssets(), path, asset)); } } return resources; } catch (IOException e) { throw new ClassPathScanException(e); } }