Commit 016eaffa by Ashutosh Mestry

ATLAS-2897: Better handling of empty zip files.

parent 8a26c79e
......@@ -65,7 +65,6 @@ public class AtlasServerService {
try {
return dataAccess.load(server);
} catch (AtlasBaseException e) {
LOG.error("dataAccess", e);
throw e;
}
}
......
......@@ -72,10 +72,14 @@ public class ZipSource implements EntityImportStream {
}
private boolean isZipFileEmpty() {
return MapUtils.isEmpty(guidEntityJsonMap) ||
(guidEntityJsonMap.containsKey(ZipExportFileNames.ATLAS_EXPORT_ORDER_NAME.toString()) &&
(guidEntityJsonMap.get(ZipExportFileNames.ATLAS_EXPORT_ORDER_NAME.toString()) == null)
);
if (MapUtils.isEmpty(guidEntityJsonMap)) {
return true;
}
String key = ZipExportFileNames.ATLAS_EXPORT_ORDER_NAME.toString();
return (guidEntityJsonMap.containsKey(key) &&
StringUtils.isNotEmpty(guidEntityJsonMap.get(key)) &&
guidEntityJsonMap.get(key).equals("[]"));
}
public ImportTransforms getImportTransform() { return this.importTransform; }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment