From 7e394e7746150699b42b464970d8ad71c462996d Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 22 Dec 2014 10:22:57 +0200 Subject: java: DONT_BACKUP_USERLAYER parameter is unused Change-Id: I2e66a6acfd50b929d43ffdb3e468042875b6b23d --- qadevOOo/runner/helper/OfficeProvider.java | 50 +++++++++++++----------------- qadevOOo/runner/util/PropertyName.java | 4 --- 2 files changed, 22 insertions(+), 32 deletions(-) (limited to 'qadevOOo') diff --git a/qadevOOo/runner/helper/OfficeProvider.java b/qadevOOo/runner/helper/OfficeProvider.java index a1d39100ccbf..8b20a3cf99c2 100644 --- a/qadevOOo/runner/helper/OfficeProvider.java +++ b/qadevOOo/runner/helper/OfficeProvider.java @@ -281,10 +281,7 @@ public class OfficeProvider implements AppProvider } else if (isExecutable) { - if (!param.getBool(util.PropertyName.DONT_BACKUP_USERLAYER)) - { - backupUserLayer(param, msf); - } + backupUserLayer(param, msf); } } else @@ -515,39 +512,36 @@ public class OfficeProvider implements AppProvider param.remove("AppProvider"); param.remove("ServiceFactory"); - if (!param.getBool(util.PropertyName.DONT_BACKUP_USERLAYER)) + //copy user_backup into user layer + try { - //copy user_backup into user layer - try + final String userLayer = (String) param.get("userLayer"); + final String copyLayer = (String) param.get("copyLayer"); + if (userLayer != null && copyLayer != null) { - final String userLayer = (String) param.get("userLayer"); - final String copyLayer = (String) param.get("copyLayer"); - if (userLayer != null && copyLayer != null) - { - deleteFilesAndDirector(new File(userLayer)); - final File copyFile = new File(copyLayer); - dbg("copy '" + copyFile + "' -> '" + userLayer + "'"); - FileTools.copyDirectory(copyFile, new File(userLayer), new String[] - { - "temp" - }); - dbg("copy '" + copyFile + "' -> '" + userLayer + "' finished"); + deleteFilesAndDirector(new File(userLayer)); + final File copyFile = new File(copyLayer); + dbg("copy '" + copyFile + "' -> '" + userLayer + "'"); + FileTools.copyDirectory(copyFile, new File(userLayer), new String[] + { + "temp" + }); + dbg("copy '" + copyFile + "' -> '" + userLayer + "' finished"); - // remove all user_backup folder in temp dir - // this is for the case the runner was killed and some old backup folder still stay in temp dir + // remove all user_backup folder in temp dir + // this is for the case the runner was killed and some old backup folder still stay in temp dir - } - else - { - System.out.println("Cannot copy layer: '" + copyLayer + "' back to user layer: '" + userLayer + "'"); - } } - catch (java.io.IOException e) + else { - dbg("Couldn't recover from backup\n" + e.getMessage()); + System.out.println("Cannot copy layer: '" + copyLayer + "' back to user layer: '" + userLayer + "'"); } } + catch (java.io.IOException e) + { + dbg("Couldn't recover from backup\n" + e.getMessage()); + } return result; } diff --git a/qadevOOo/runner/util/PropertyName.java b/qadevOOo/runner/util/PropertyName.java index 1932a74c6fa7..7a37125eb7ce 100644 --- a/qadevOOo/runner/util/PropertyName.java +++ b/qadevOOo/runner/util/PropertyName.java @@ -170,8 +170,4 @@ public interface PropertyName { */ String UNXMACXI = "unxmacxi"; - /** - * can be used to dont backup the user layer, faster office start/stop but less secure default is to backup the user layer - */ - String DONT_BACKUP_USERLAYER = "DontBackupUserLayer"; } -- cgit