JAL-4277 --mkdirs with cautious refusal for paths with ..
[jalview.git] / src / jalview / gui / AlignFrame.java
index dba400e..f3cb012 100644 (file)
@@ -1252,10 +1252,11 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
    */
   public void saveAlignment(String file, FileFormatI format)
   {
-    saveAlignment(file, format, false);
+    saveAlignment(file, format, false, false);
   }
 
-  public void saveAlignment(String file, FileFormatI format, boolean stdout)
+  public void saveAlignment(String file, FileFormatI format, boolean stdout,
+          boolean forceBackup)
   {
     lastSaveSuccessful = true;
     if (!stdout)
@@ -1308,7 +1309,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
       else
       {
         // create backupfiles object and get new temp filename destination
-        boolean doBackup = BackupFiles.getEnabled() && !stdout;
+        boolean doBackup = forceBackup
+                || (BackupFiles.getEnabled() && !stdout);
         BackupFiles backupfiles = null;
         if (doBackup)
         {