Kaydet (Commit) 7e394e77 authored tarafından Noel Grandin's avatar Noel Grandin

java: DONT_BACKUP_USERLAYER parameter is unused

Change-Id: I2e66a6acfd50b929d43ffdb3e468042875b6b23d
üst 000e24d2
...@@ -281,10 +281,7 @@ public class OfficeProvider implements AppProvider ...@@ -281,10 +281,7 @@ public class OfficeProvider implements AppProvider
} }
else if (isExecutable) else if (isExecutable)
{ {
if (!param.getBool(util.PropertyName.DONT_BACKUP_USERLAYER)) backupUserLayer(param, msf);
{
backupUserLayer(param, msf);
}
} }
} }
else else
...@@ -515,39 +512,36 @@ public class OfficeProvider implements AppProvider ...@@ -515,39 +512,36 @@ public class OfficeProvider implements AppProvider
param.remove("AppProvider"); param.remove("AppProvider");
param.remove("ServiceFactory"); param.remove("ServiceFactory");
if (!param.getBool(util.PropertyName.DONT_BACKUP_USERLAYER)) //copy user_backup into user layer
try
{ {
//copy user_backup into user layer final String userLayer = (String) param.get("userLayer");
try final String copyLayer = (String) param.get("copyLayer");
if (userLayer != null && copyLayer != null)
{ {
final String userLayer = (String) param.get("userLayer"); deleteFilesAndDirector(new File(userLayer));
final String copyLayer = (String) param.get("copyLayer"); final File copyFile = new File(copyLayer);
if (userLayer != null && copyLayer != null) dbg("copy '" + copyFile + "' -> '" + userLayer + "'");
{ FileTools.copyDirectory(copyFile, new File(userLayer), new String[]
deleteFilesAndDirector(new File(userLayer)); {
final File copyFile = new File(copyLayer); "temp"
dbg("copy '" + copyFile + "' -> '" + userLayer + "'"); });
FileTools.copyDirectory(copyFile, new File(userLayer), new String[] dbg("copy '" + copyFile + "' -> '" + userLayer + "' finished");
{
"temp"
});
dbg("copy '" + copyFile + "' -> '" + userLayer + "' finished");
// remove all user_backup folder 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 // 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; return result;
} }
......
...@@ -170,8 +170,4 @@ public interface PropertyName { ...@@ -170,8 +170,4 @@ public interface PropertyName {
*/ */
String UNXMACXI = "unxmacxi"; 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";
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment