X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fio%2FBackupFiles.java;h=14c1260bbac561167382e2af1f2f2329ad79a589;hb=d14d7360a1855481eadb19536b86253bbc8eccdc;hp=3024edf42138e8c0aadf34a7532145369ecb3e5f;hpb=5db57ea2e44da7e8f3d5ff0866b0b81cd4458aeb;p=jalview.git diff --git a/src/jalview/io/BackupFiles.java b/src/jalview/io/BackupFiles.java index 3024edf..14c1260 100644 --- a/src/jalview/io/BackupFiles.java +++ b/src/jalview/io/BackupFiles.java @@ -167,29 +167,32 @@ public class BackupFiles public static boolean hasSavesInProgress() { boolean has = false; - for (CompletableFuture cf : savesInProgressCompletableFutures()) + for (CompletableFuture cf : savesInProgressCompletableFutures(true)) { has |= !cf.isDone(); } return has; } - public static List savesInProgressFiles() + public static List savesInProgressFiles(boolean all) { List files = new ArrayList<>(); for (BackupFiles bfile : savesInProgress) { - files.add(bfile.getFile()); + if (all || !bfile.getMyFuture().isDone()) + files.add(bfile.getFile()); } return files; } - public static List> savesInProgressCompletableFutures() + public static List> savesInProgressCompletableFutures( + boolean all) { List> cfs = new ArrayList<>(); for (BackupFiles bfile : savesInProgress) { - cfs.add(bfile.getMyFuture()); + if (all || !bfile.getMyFuture().isDone()) + cfs.add(bfile.getMyFuture()); } return cfs; } @@ -250,6 +253,7 @@ public class BackupFiles { String tempfilename = file.getName(); File tempdir = file.getParentFile(); + tempdir.mkdirs(); Console.trace( "BACKUPFILES [file!=null] attempting to create temp file for " + tempfilename + " in dir " + tempdir);