updating download functionality and removing no longer necessary hack
@@ -138,7 +138,7 @@ class MastClass(QueryWithLogin):
super(MastClass, self).__init__()
self._MAST_REQUEST_URL = conf.server + "/api/v0/invoke"
- self._MAST_DOWNLOAD_URL = conf.server + "/api/v0/download/file/"
+ self._MAST_DOWNLOAD_URL = conf.server + "/api/v0/download/file"
self._COLUMNS_CONFIG_URL = conf.server + "/portal/Mashup/Mashup.asmx/columnsconfig"
# shibbolith urls
@@ -1287,16 +1287,7 @@ class ObservationsClass(MastClass):
for dataProduct in products:
localPath = base_dir + "/" + dataProduct['obs_collection'] + "/" + dataProduct['obs_id']
-
- dataUrl = dataProduct['dataURI']
- if "http" not in dataUrl: # url is actually a uri
- dataUrl = self._MAST_DOWNLOAD_URL + dataUrl.lstrip("mast:")
-
- # HACK: user identity info not passed properly to downloader
- # using /api/v0 url, so if user is logged in go through portal url
- # (will be fixed server side in next, this is a temporary workaround)
- if self.session_info(True)["Username"] != "anonymous":
- dataUrl = dataUrl.replace("api/v0", "portal")
+ dataUrl = self._MAST_DOWNLOAD_URL + "?uri=" + dataProduct['dataURI']
if not os.path.exists(localPath):
os.makedirs(localPath)
