|
68 | 68 | import java.util.List;
|
69 | 69 | import java.util.Optional;
|
70 | 70 | import java.util.Set;
|
| 71 | +import java.util.TimeZone; |
71 | 72 | import java.util.logging.Level;
|
72 | 73 | import java.util.logging.Logger;
|
73 | 74 |
|
@@ -263,7 +264,9 @@ public ValidationReport convertReportDTOToPersistent(Users user, Featuregroup fe
|
263 | 264 | JSONObject reportMeta = new JSONObject(reportDTO.getMeta());
|
264 | 265 | String validationTimeString = reportMeta.getString("validation_time");
|
265 | 266 | String formatDateString = "yyyyMMdd'T'HHmmss.SSS";
|
266 |
| - validationTime = new SimpleDateFormat(formatDateString).parse( |
| 267 | + SimpleDateFormat isoFormat = new SimpleDateFormat(formatDateString); |
| 268 | + isoFormat.setTimeZone(TimeZone.getTimeZone("UTC")); |
| 269 | + validationTime = isoFormat.parse( |
267 | 270 | validationTimeString.substring(0, validationTimeString.length() - 4));
|
268 | 271 | } catch (JSONException | ParseException exception) {
|
269 | 272 | validationTime = new Date();
|
@@ -311,16 +314,16 @@ private Inode registerValidationReportToDisk(Users user, Featuregroup featuregro
|
311 | 314 | udfso.mkdir(reportDirPath.toString());
|
312 | 315 | }
|
313 | 316 | SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd'T'HHmmss");
|
| 317 | + formatter.setTimeZone(TimeZone.getTimeZone("UTC")); |
314 | 318 | String fileName = String.format("validation_report_%s.json", formatter.format(validationTime));
|
315 | 319 | Path reportPath = new Path(reportDirPath, fileName);
|
316 | 320 | if (udfso.exists(reportPath)) {
|
317 | 321 | throw new FeaturestoreException(RESTCodes.FeaturestoreErrorCode.ERROR_SAVING_ON_DISK_VALIDATION_REPORT,
|
318 | 322 | Level.SEVERE, String.format("Validation report with file name %s already exists.", fileName));
|
319 | 323 | }
|
320 | 324 | udfso.create(reportPath, reportJSON.toString());
|
321 |
| - Inode inode = inodeController.getInodeAtPath(reportPath.toString()); |
322 |
| - |
323 |
| - return inode; |
| 325 | + |
| 326 | + return inodeController.getInodeAtPath(reportPath.toString()); |
324 | 327 | } catch (DatasetException | HopsSecurityException | IOException e) {
|
325 | 328 | throw new FeaturestoreException(RESTCodes.FeaturestoreErrorCode.ERROR_SAVING_ON_DISK_VALIDATION_REPORT,
|
326 | 329 | Level.WARNING, e.getMessage());
|
|
0 commit comments