public boolean exists() { return getUrl() != null; }
@Override public List<Resource> scanForResources(Location path, ResourceFilter predicate) { try { List<Resource> resources = new ArrayList<Resource>(); Set<String> resourceNames = findResourceNames(path, predicate); for (String resourceName : resourceNames) { resources.add(new ClassPathResource(resourceName, classLoader)); LOG.trace("... found resource: {}", resourceName); } return resources; } catch (IOException e) { throw new ClassPathScanException(e); } }
public String getLocationOnDisk() { URL url = getUrl(); if (url == null) { throw new ClassPathScanException("Unable to location resource on disk: " + location); } try { return new File(URLDecoder.decode(url.getPath(), "UTF-8")).getAbsolutePath(); } catch (UnsupportedEncodingException e) { throw new ClassPathScanException("Unknown encoding: UTF-8", e); } }