/** * Resource corresponding to the config location. * * @return resource */ public Resource toResource() { if (configLocation.startsWith(File.separator) || new File(configLocation).isAbsolute()) { try { return getUrlResource(); } catch (MalformedURLException e) { throw new MotechConfigurationException(String.format("Invalid config location %s.", configLocation), e); } } else { return new ClassPathResource(configLocation); } }