URL queryUrl = _getQueryUrl(queryArgs);
LOG.info("URL = " + queryUrl);
if (_type.equals(IMAGE_SERVER)) {
return new URLQueryResult(queryUrl);
}
if (_progressPanel == null) {
_progressPanel = ProgressPanel.makeProgressPanel("Downloading query results ...");
}
ProgressBarFilterInputStream in = null;
try {
URLConnection connection = _progressPanel.openConnection(queryUrl);
String contentType = connection.getContentType();
if (contentType != null && contentType.equals("text/html")) {
// might be an HTML error from the catalog server
return new URLQueryResult(queryUrl);
}
InputStream ins = connection.getInputStream();
in = _progressPanel.getLoggedInputStream(ins, connection.getContentLength());
return _makeQueryResult(in, queryArgs);
} finally {