/** * Gets a resource for a document path. The resource will either live in the class path as a class * file or as an entry in one of the JAR files on the class path. * * @param documentPath * * @return Resource or null if not found */ private Resource getDocumentResource(String documentPath) { String resourcePath = toResourcePath(documentPath); // return the resource from the wrapped resolver // this does not require the classpath*: prefix return resolver.getResource(resourcePath); }
/** * Gets a resource for a document path. The resource will either live in the class path as a class * file or as an entry in one of the JAR files on the class path. * * @param documentPath String * * @return Resource or null if not found */ private Resource getDocumentResource(String documentPath) { String resourcePath = toResourcePath(documentPath); // return the resource from the wrapped resolver // this does not require the classpath*: prefix return resolver.getResource(resourcePath); }
/** * Gets a resource for a document path. The resource will either live in the class path as a class * file or as an entry in one of the JAR files on the class path. * * @param documentPath String * * @return Resource or null if not found */ private Resource getDocumentResource(String documentPath) { String resourcePath = toResourcePath(documentPath); // return the resource from the wrapped resolver // this does not require the classpath*: prefix return resolver.getResource(resourcePath); }
/** * Gets resources that match a given location pattern. A resource in the returned array can live * in the class path as either a class file or as an entry within one of the JAR files in the * class path. * * @param locationPattern * * @return Resource[] of resource that match location pattern - can be empty but never null * * @throws IOException */ private Resource[] getDocumentResources(String locationPattern) throws IOException { String resourcePath = toResourcePath(locationPattern); Resource[] resources = resolver.getResources("classpath*:" + resourcePath); ArrayList<Resource> list = new ArrayList<Resource>(resources.length); for (Resource resource : resources) { // only keep documents, not directories if (!resource.getURL().toExternalForm().endsWith("/")) { list.add(resource); } } return list.toArray(new Resource[list.size()]); }
/** * Gets resources that match a given location pattern. A resource in the returned array can live * in the class path as either a class file or as an entry within one of the JAR files in the * class path. * * @param locationPattern String * * @return Resource[] of resource that match location pattern - can be empty but never null * * @throws IOException */ private Resource[] getDocumentResources(String locationPattern) throws IOException { String resourcePath = toResourcePath(locationPattern); Resource[] resources = resolver.getResources("classpath*:" + resourcePath); ArrayList<Resource> list = new ArrayList<Resource>(resources.length); for (Resource resource : resources) { // only keep documents, not directories if (!resource.getURL().toExternalForm().endsWith("/")) { list.add(resource); } } return list.toArray(new Resource[list.size()]); }
/** * Gets resources that match a given location pattern. A resource in the returned array can live * in the class path as either a class file or as an entry within one of the JAR files in the * class path. * * @param locationPattern String * * @return Resource[] of resource that match location pattern - can be empty but never null * * @throws IOException */ private Resource[] getDocumentResources(String locationPattern) throws IOException { String resourcePath = toResourcePath(locationPattern); Resource[] resources = resolver.getResources("classpath*:" + resourcePath); ArrayList<Resource> list = new ArrayList<Resource>(resources.length); for (Resource resource : resources) { // only keep documents, not directories if (!resource.getURL().toExternalForm().endsWith("/")) { list.add(resource); } } return list.toArray(new Resource[list.size()]); }