From: <ms...@us...> - 2010-01-16 15:05:42
|
Revision: 10518 http://wonder.svn.sourceforge.net/wonder/?rev=10518&view=rev Author: mschrag Date: 2010-01-16 15:05:34 +0000 (Sat, 16 Jan 2010) Log Message: ----------- ... actually, we want to do an existence check on the resolved file, so go ahead and resolve and then do tests on the resolved file. we should only fail if the resolved file doesn't exist. (2.0 version) Modified Paths: -------------- branches/Wonder_2_0_0_Branch/Wonder/Common/Frameworks/ERExtensions/Sources/er/extensions/ERXProperties.java Modified: branches/Wonder_2_0_0_Branch/Wonder/Common/Frameworks/ERExtensions/Sources/er/extensions/ERXProperties.java =================================================================== --- branches/Wonder_2_0_0_Branch/Wonder/Common/Frameworks/ERExtensions/Sources/er/extensions/ERXProperties.java 2010-01-16 15:05:23 UTC (rev 10517) +++ branches/Wonder_2_0_0_Branch/Wonder/Common/Frameworks/ERExtensions/Sources/er/extensions/ERXProperties.java 2010-01-16 15:05:34 UTC (rev 10518) @@ -890,19 +890,20 @@ if (!mainPropsFile.exists() && !mainPropsFile.isAbsolute()) { mainPropsFile = new File(userHome, replacementPropsName); } + File resolvedMainPropsFile = mainPropsFile; if (ERXProperties._shouldRequireSymlinkedGlobalAndIncludeProperties()) { // MS: Don't return the resolved link here because we need to reload off // the symlink rather than its target, but we need to block to make sure // the symlink DOES exist. - /*mainPropsFile = */_NSFileUtilities.resolveLink(mainPropsFile.getPath(), mainPropsFile.getName()); + resolvedMainPropsFile = _NSFileUtilities.resolveLink(mainPropsFile.getPath(), mainPropsFile.getName()); } - if (!mainPropsFile.exists()) { + if (!resolvedMainPropsFile.exists()) { throw new RuntimeException("There was no global properties file '" + replacementPropsName + "' (canonical path = '" + safeCanonicalPath(new File(replacementPropsName)) + ")."); } - if (!mainPropsFile.isFile()) { + if (!resolvedMainPropsFile.isFile()) { throw new RuntimeException("The path '" + replacementPropsName + "' (canonical path = '" + safeCanonicalPath(new File(replacementPropsName)) + ") was not a file."); } - if (!mainPropsFile.canRead()) { + if (!resolvedMainPropsFile.canRead()) { throw new RuntimeException("The path '" + replacementPropsName + "' (canonical path = '" + safeCanonicalPath(new File(replacementPropsName)) + ") could not be read."); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |