From 5b9362e956ab4d0a9fb324c5bb3a9cdae740865f Mon Sep 17 00:00:00 2001 From: Tom Morris Date: Tue, 15 Feb 2011 23:15:09 +0000 Subject: [PATCH] Issue 334 - Make sure URLs are encoded before using them. git-svn-id: http://google-refine.googlecode.com/svn/trunk@2007 7d457c2a-affb-35e4-300a-418c747d4874 --- .../google/refine/commands/project/CreateProjectCommand.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/main/src/com/google/refine/commands/project/CreateProjectCommand.java b/main/src/com/google/refine/commands/project/CreateProjectCommand.java index dee2ccf3f..8c5b8c36a 100644 --- a/main/src/com/google/refine/commands/project/CreateProjectCommand.java +++ b/main/src/com/google/refine/commands/project/CreateProjectCommand.java @@ -43,6 +43,7 @@ import java.io.InputStreamReader; import java.io.Reader; import java.io.Serializable; import java.io.UnsupportedEncodingException; +import java.net.URI; import java.net.URL; import java.net.URLConnection; import java.util.ArrayList; @@ -393,7 +394,10 @@ public class CreateProjectCommand extends Command { Properties options, String urlString) throws Exception { + // Little dance to get URL properly encoded (e.g. for funky Fusion Tables queries) URL url = new URL(urlString); + url = new URI(url.getProtocol(), url.getHost(), url.getPath(), url.getQuery(), null).toURL(); + URLConnection connection = null; // Try for a URL importer first