X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fio%2FBackupFiles.java;h=c67c307d223badfe1d10349283b4a846e57aee75;hb=c24ec44edbedba55005373c43bf712c047b56faa;hp=911204272b2f282ae352da05bf8e19129a3877b2;hpb=772049d78841aff3a1d40386eb9536d8aef8b644;p=jalview.git diff --git a/src/jalview/io/BackupFiles.java b/src/jalview/io/BackupFiles.java index 9112042..c67c307 100644 --- a/src/jalview/io/BackupFiles.java +++ b/src/jalview/io/BackupFiles.java @@ -232,6 +232,12 @@ public class BackupFiles public BackupFiles(File file) { classInit(); + if (file.getParentFile() == null) + { + // filename probably in pwd represented with no parent -- fix it before + // it's a problem + file = file.getAbsoluteFile(); + } this.file = file; // add this file from the save in progress stack @@ -252,7 +258,8 @@ public class BackupFiles if (file != null) { String tempfilename = file.getName(); - File tempdir = file.getParentFile(); + File tempdir = file.getAbsoluteFile().getParentFile(); + tempdir.mkdirs(); Console.trace( "BACKUPFILES [file!=null] attempting to create temp file for " + tempfilename + " in dir " + tempdir); @@ -282,7 +289,7 @@ public class BackupFiles this.setTempFile(temp); } - public static void classInit() + private static void classInit() { Console.initLogger(); Console.trace("BACKUPFILES classInit");