incubator-ooo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From liu...@apache.org
Subject svn commit: r1386976 - /incubator/ooo/trunk/test/testcommon/source/org/openoffice/test/common/FileUtil.java
Date Tue, 18 Sep 2012 03:20:57 GMT
Author: liuzhe
Date: Tue Sep 18 03:20:57 2012
New Revision: 1386976

URL: http://svn.apache.org/viewvc?rev=1386976&view=rev
Log:
The name of the file downloaded from URL is not correct

Modified:
    incubator/ooo/trunk/test/testcommon/source/org/openoffice/test/common/FileUtil.java

Modified: incubator/ooo/trunk/test/testcommon/source/org/openoffice/test/common/FileUtil.java
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/test/testcommon/source/org/openoffice/test/common/FileUtil.java?rev=1386976&r1=1386975&r2=1386976&view=diff
==============================================================================
--- incubator/ooo/trunk/test/testcommon/source/org/openoffice/test/common/FileUtil.java (original)
+++ incubator/ooo/trunk/test/testcommon/source/org/openoffice/test/common/FileUtil.java Tue
Sep 18 03:20:57 2012
@@ -36,6 +36,7 @@ import java.io.InputStream;
 import java.io.InputStreamReader;
 import java.io.OutputStream;
 import java.net.MalformedURLException;
+import java.net.URI;
 import java.net.URL;
 import java.net.URLConnection;
 import java.text.DateFormat;
@@ -914,8 +915,8 @@ public class FileUtil {
 		InputStream in = null;
 		OutputStream out = null;
 		try {
-			URL url = new URL(urlString);
-			URLConnection urlConnection = url.openConnection();
+			URI url = new URI(urlString);
+			URLConnection urlConnection = url.toURL().openConnection();
 			int totalSize = urlConnection.getContentLength();
 			in = urlConnection.getInputStream();
 			if (output.isDirectory()) 



Mime
View raw message