X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fio%2FBackupFiles.java;h=c67c307d223badfe1d10349283b4a846e57aee75;hb=faf491e024f9835435f5dd6c20a033250dd9297d;hp=14c1260bbac561167382e2af1f2f2329ad79a589;hpb=cd443f0faad6561791b4ae9a617bed680036959a;p=jalview.git diff --git a/src/jalview/io/BackupFiles.java b/src/jalview/io/BackupFiles.java index 14c1260..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,7 @@ 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 " @@ -283,7 +289,7 @@ public class BackupFiles this.setTempFile(temp); } - public static void classInit() + private static void classInit() { Console.initLogger(); Console.trace("BACKUPFILES classInit");