static SqlFragments parseResource(URL[] resources, ElSqlConfig config) { List<List<String>> files = new ArrayList<List<String>>(); boolean resourceFound = false; for (URL resource : resources) { if (resource != null) { resourceFound = true; List<String> lines = loadResource(resource); files.add(lines); } } if (!resourceFound) { throw new IllegalArgumentException("No matching resource was found"); } return parse(files, config); }
private static ElSqlBundle parseResource(Resource[] resources, ElSqlConfig config) { List<List<String>> files = new ArrayList<List<String>>(); boolean resourceFound = false; for (Resource resource : resources) { if (resource.exists()) { resourceFound = true; URL url; try { url = resource.getURL(); } catch (IOException ex) { throw new RuntimeException(ex); } List<String> lines = SqlFragments.loadResource(url); files.add(lines); } } if (!resourceFound) { throw new IllegalArgumentException("No matching resource was found"); } return new ElSqlBundle(SqlFragments.parse(files, config)); }