From 0d3c784166f166da0d5b3151d8269ea165563c35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9gory=20Mantelet?= <gregory.mantelet@astro.unistra.fr> Date: Mon, 20 Aug 2018 15:40:20 +0200 Subject: [PATCH] [UWS] Fix warnings while restoring a backup. The attribute `version` in the node `job` is never restored ; it is just informative. Thus, it is now silently ignored. The attribute `length` of an upload was badly spelled. The attribute `mime-type` of a result was backuped as `mime-type` but restored as `mime`. Hence the absence of this piece of information when restoring a job. --- src/uws/service/backup/DefaultUWSBackupManager.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/uws/service/backup/DefaultUWSBackupManager.java b/src/uws/service/backup/DefaultUWSBackupManager.java index 3cff931..e9079fb 100644 --- a/src/uws/service/backup/DefaultUWSBackupManager.java +++ b/src/uws/service/backup/DefaultUWSBackupManager.java @@ -721,7 +721,7 @@ public class DefaultUWSBackupManager implements UWSBackupManager { o.put("fileName", upl.fileName); o.put("location", upl.getLocation()); o.put("mime", upl.mimeType); - o.put("lenght", upl.length); + o.put("length", upl.length); return o; } @@ -1048,8 +1048,9 @@ public class DefaultUWSBackupManager implements UWSBackupManager { else if (key.equalsIgnoreCase(UWSJob.PARAM_JOB_INFO)){ jobInfo = restoreJobInfo(json.get(key)); - }// Ignore any other key but with a warning message: - else + } + // Ignore any other key but with a warning message: + else if (!key.equalsIgnoreCase("version")) getLogger().logUWS(LogLevel.WARNING, json, "RESTORATION", "The job attribute '" + key + "' has been ignored because unknown! A job may be not completely restored!", null); }catch(JSONException je){ @@ -1247,7 +1248,7 @@ public class DefaultUWSBackupManager implements UWSBackupManager { type = obj.getString(n); else if (n.equalsIgnoreCase("href")) href = obj.getString(n); - else if (n.equalsIgnoreCase("mime")) + else if (n.equalsIgnoreCase("mime-type")) mime = obj.getString(n); else if (n.equalsIgnoreCase("redirection")) redirection = obj.getBoolean(n); -- GitLab