From bd7453adbac27db9d4b9501e5292832ce0473521 Mon Sep 17 00:00:00 2001 From: David Huynh Date: Wed, 25 Aug 2010 17:35:16 +0000 Subject: [PATCH] Made sure to strip off charset from content-type when importing from URLs before looking up for the right importer. git-svn-id: http://google-refine.googlecode.com/svn/trunk@1229 7d457c2a-affb-35e4-300a-418c747d4874 --- .../gridworks/commands/project/CreateProjectCommand.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/main/src/com/google/gridworks/commands/project/CreateProjectCommand.java b/main/src/com/google/gridworks/commands/project/CreateProjectCommand.java index 6a90e58c6..07cf88545 100644 --- a/main/src/com/google/gridworks/commands/project/CreateProjectCommand.java +++ b/main/src/com/google/gridworks/commands/project/CreateProjectCommand.java @@ -372,7 +372,13 @@ public class CreateProjectCommand extends Command { } try { - importer = ImporterRegistry.guessImporter(connection.getContentType(), url.getPath()); + String contentType = connection.getContentType(); + int semicolon = contentType.indexOf(';'); + if (semicolon >= 0) { + contentType = contentType.substring(0, semicolon); + } + + importer = ImporterRegistry.guessImporter(contentType, url.getPath()); internalInvokeImporter(project, importer, options, inputStream, connection.getContentEncoding()); } finally {