From: <fg...@us...> - 2007-02-06 14:33:02
|
Revision: 235 http://svn.sourceforge.net/openutils/?rev=235&view=rev Author: fgiust Date: 2007-02-06 06:32:57 -0800 (Tue, 06 Feb 2007) Log Message: ----------- handle missing file resources (check didn't work properly for non-classpath resources) Modified Paths: -------------- trunk/openutils-deployment/src/main/java/it/openutils/deployment/spring/EnvironmentPropertyConfigurer.java Modified: trunk/openutils-deployment/src/main/java/it/openutils/deployment/spring/EnvironmentPropertyConfigurer.java =================================================================== --- trunk/openutils-deployment/src/main/java/it/openutils/deployment/spring/EnvironmentPropertyConfigurer.java 2007-02-06 13:50:58 UTC (rev 234) +++ trunk/openutils-deployment/src/main/java/it/openutils/deployment/spring/EnvironmentPropertyConfigurer.java 2007-02-06 14:32:57 UTC (rev 235) @@ -193,10 +193,12 @@ try { url = ResourceUtils.getURL(resource); + url.openStream().close(); // test if the resource actually exists } - catch (FileNotFoundException e) + catch (IOException e) { // ignore, can be normal + url = null; } } return url; @@ -215,7 +217,7 @@ return StringUtils.substringAfterLast(url, "/"); } - return null; + return StringUtils.EMPTY; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |