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:
parent
51c586bc2c
commit
b3f8ce83c1
@ -277,11 +277,16 @@ public class ImportingUtilities {
|
|||||||
HttpURLConnection httpConnection = (HttpURLConnection) urlConnection;
|
HttpURLConnection httpConnection = (HttpURLConnection) urlConnection;
|
||||||
RefineServlet.setUserAgent(httpConnection);
|
RefineServlet.setUserAgent(httpConnection);
|
||||||
}
|
}
|
||||||
|
// TODO: Set Accept-Encoding on connection so we don't get stuff we can't handle?
|
||||||
urlConnection.connect();
|
urlConnection.connect();
|
||||||
|
|
||||||
InputStream stream2 = urlConnection.getInputStream();
|
InputStream stream2 = urlConnection.getInputStream();
|
||||||
try {
|
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();
|
int contentLength = urlConnection.getContentLength();
|
||||||
if (contentLength > 0) {
|
if (contentLength > 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user