MifosResourceUtil { public static Resource[] getClassPathResourcesAsResources(String pattern) throws IOException { return resourcePatternResolver.getResources(ResourcePatternResolver.CLASSPATH_ALL_URL_PREFIX + "/" + pattern); } private  MifosResourceUtil(); static File getFile(String fileNameWithLocation); static Reader getSQLFileAsReader(String fileName); static InputStream getSQLFileAsStream(String fileName); static InputStream[] getSQLFilesAsStreams(String[] fileNames); static InputStream getClassPathResourceAsStream(String fileName); static Resource getClassPathResourceAsResource(String fileName); static String getClassPathResourceAsURIString(String path); static Resource[] getClassPathResourcesAsResources(String pattern);  }
@Test public void testGetResources() throws IOException { Resource[] found = MifosResourceUtil.getClassPathResourcesAsResources("org/mifos/core/resources/included*.xml"); assertEquals(2, found.length); for (Resource resource : found) { String f = resource.getFilename(); if (!"y.xml".equals(f) && !"z.xml".equals(f)) { fail(resource + " should not have been returned"); } } }