From ec03ef31b63a14c27c06cb1bf22e05f50a499c1c Mon Sep 17 00:00:00 2001 From: Roger Ferrel Date: Thu, 7 Aug 2014 14:17:24 -0500 Subject: [PATCH] Issue #3507 Merge fixes for Archive Case Creation. Former-commit-id: d7b2355016371e5ec4112039485f9669806f09f6 [formerly d7b2355016371e5ec4112039485f9669806f09f6 [formerly 2263bd75920d4fbaf2bfc3445e4b320291401c16]] Former-commit-id: 4f946d49216eb2c087710ce79140e72d58c4dcfa Former-commit-id: 4891c9f540b466ccde64324856522a3fa339dc67 --- .../uf/viz/archive/ui/CaseCreationDlg.java | 1 + .../uf/viz/archive/ui/GenerateCaseDlg.java | 28 +++++++++++++------ 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/ui/CaseCreationDlg.java b/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/ui/CaseCreationDlg.java index 08ba6aaebc..073216d7e8 100644 --- a/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/ui/CaseCreationDlg.java +++ b/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/ui/CaseCreationDlg.java @@ -187,6 +187,7 @@ public class CaseCreationDlg extends AbstractArchiveDlg { this.type = Type.Case; this.setSelect = false; this.type = Type.Case; + this.defaultCaseDir = defaultCaseDir; this.ccManager = new CaseCreationManager(); } diff --git a/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/ui/GenerateCaseDlg.java b/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/ui/GenerateCaseDlg.java index 1f83de85bf..3c924823ec 100644 --- a/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/ui/GenerateCaseDlg.java +++ b/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/ui/GenerateCaseDlg.java @@ -661,18 +661,19 @@ public class GenerateCaseDlg extends CaveSWTDialog { try { // Allow the caseCopy to clean its resources. caseCopy.finishCase(); - } catch (CaseCreateException ex) { + } catch (Exception ex) { // Ignore } caseCopy = null; } - timer.stop(); - if (statusHandler.isPriorityEnabled(Priority.INFO)) { - String message = String.format("Case %s took %s.", - caseDir.getName(), - TimeUtil.prettyDuration(timer.getElapsedTime())); - statusHandler.handle(Priority.INFO, message); - } + timer.stop(); + if (statusHandler.isPriorityEnabled(Priority.INFO)) { + String message = String + .format("Case %s took %s.", caseDir.getName(), + TimeUtil.prettyDuration(timer + .getElapsedTime())); + statusHandler.handle(Priority.INFO, message); + } } // Release current lock. @@ -1356,6 +1357,17 @@ public class GenerateCaseDlg extends CaveSWTDialog { zipStream.flush(); fileStream.flush(); + /* + * Most likely over estimates the size since it is unknown how well + * file will compress. + */ + long size = tarFile.length() + file.length(); + if (size >= splitSize) { + closeStreams(); + openStreams(); + addParentDir(file); + } + } } /** Task to update the lock plugin's last execute time. */