From: <asa...@us...> - 2012-11-26 06:52:36
|
Revision: 7772 http://sourceforge.net/p/htmlunit/code/7772 Author: asashour Date: 2012-11-26 06:52:33 +0000 (Mon, 26 Nov 2012) Log Message: ----------- Correctly handle local file URL if it is in a separate driver (Windows). Issue 1464 Modified Paths: -------------- trunk/htmlunit/src/changes/changes.xml trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/WebClient.java Modified: trunk/htmlunit/src/changes/changes.xml =================================================================== --- trunk/htmlunit/src/changes/changes.xml 2012-11-26 06:38:07 UTC (rev 7771) +++ trunk/htmlunit/src/changes/changes.xml 2012-11-26 06:52:33 UTC (rev 7772) @@ -8,6 +8,9 @@ <body> <release version="2.12" date="???" description="Bugfixes"> + <action type="fix" dev="asashour" issue="1464"> + Correctly handle local file URL if it is in a separate driver (Windows). + </action> <action type="fix" dev="asashour"> JavaScript: fix the return value of element.getAttribute() in standards mode (IE). </action> Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/WebClient.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/WebClient.java 2012-11-26 06:38:07 UTC (rev 7771) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/WebClient.java 2012-11-26 06:52:33 UTC (rev 7772) @@ -46,7 +46,6 @@ import net.sourceforge.htmlunit.corejs.javascript.ScriptableObject; import org.apache.commons.codec.DecoderException; -import org.apache.commons.io.FileUtils; import org.apache.commons.io.IOUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; @@ -1286,7 +1285,7 @@ cleanUrl = UrlUtils.getUrlWithNewRef(cleanUrl, null); } - final File file = FileUtils.toFile(cleanUrl); + final File file = new File(cleanUrl.toExternalForm().substring(5)); if (!file.exists()) { // construct 404 final List<NameValuePair> compiledHeaders = new ArrayList<NameValuePair>(); |