Issue 553 - Make sure we have a usable filename when importing from a URL

git-svn-id: http://google-refine.googlecode.com/svn/trunk@2481 7d457c2a-affb-35e4-300a-418c747d4874
This commit is contained in:
Tom Morris 2012-03-16 20:16:18 +00:00
parent 51c586bc2c
commit b3f8ce83c1

View File

@ -277,11 +277,16 @@ public class ImportingUtilities {
HttpURLConnection httpConnection = (HttpURLConnection) urlConnection;
RefineServlet.setUserAgent(httpConnection);
}
// TODO: Set Accept-Encoding on connection so we don't get stuff we can't handle?
urlConnection.connect();
InputStream stream2 = urlConnection.getInputStream();
try {
File file = allocateFile(rawDataDir, url.getFile());
String localname = url.getPath();
if (localname.isEmpty() || localname.endsWith("/")) {
localname = localname + "temp";
}
File file = allocateFile(rawDataDir, localname);
int contentLength = urlConnection.getContentLength();
if (contentLength > 0) {