List of usage examples for org.springframework.core.io UrlResource getURL
@Override
public URL getURL()
From source file:com.francetelecom.clara.cloud.commons.JndiAwarePropertyPlaceholderConfigurer.java
/** * Takes an array or Resources and for any of type UrlResource, resolves any * properties in the URL. Note that as we haven't loaded the property fiels * at this stage we are resolving properties against the system and jndi * sets (if any)//from w w w . jav a 2s.c o m * * @param locations */ @SuppressWarnings("unchecked") private void processLocationValues(Resource[] locations) { if (locations != null) { Properties props = new Properties(); HashSet visitedPlaceholders = new HashSet(); for (int i = 0; i < locations.length; i++) { if (locations[i] instanceof UrlResource) { UrlResource file = (UrlResource) locations[i]; String path; try { path = file.getURL().toString(); } catch (IOException e) { throw new RuntimeException(e); } String value = parseStringValue(path, props, visitedPlaceholders); if (!StringUtils.equals(path, value)) { UrlResource newFile; try { newFile = new UrlResource(value); } catch (MalformedURLException e) { throw new RuntimeException(e); } locations[i] = newFile; } } } } }