Browse Source

bug88297:使用升级更新插件的时候,有的jar包概率性删除失败

master
zhouping 8 years ago
parent
commit
518254d006
  1. 26
      designer_base/src/com/fr/design/RestartHelper.java

26
designer_base/src/com/fr/design/RestartHelper.java

@ -4,15 +4,11 @@ import com.fr.design.mainframe.DesignerContext;
import com.fr.general.ComparatorUtils;
import com.fr.general.FRLogger;
import com.fr.general.GeneralUtils;
import com.fr.stable.ArrayUtils;
import com.fr.stable.OperatingSystem;
import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import com.fr.stable.*;
import java.io.*;
import java.nio.channels.FileChannel;
import java.nio.channels.FileLock;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@ -153,6 +149,18 @@ public class RestartHelper {
}
try {
try {
File restartLockFile = new File(StableUtils.pathJoin(StableUtils.getInstallHome(), "restart.lock"));
StableUtils.makesureFileExist(restartLockFile);
RandomAccessFile randomAccessFile = new RandomAccessFile(restartLockFile,"rw");
FileChannel restartLockFC = randomAccessFile.getChannel();
FileLock restartLock = restartLockFC.tryLock();
if(restartLock == null) {
FRLogger.getLogger().error("restart lock null!");
}
}catch (Exception e){
FRLogger.getLogger().error(e.getMessage());
}
if (OperatingSystem.isMacOS()) {
restartInMacOS(installHome, filesToBeDelete);
} else {

Loading…
Cancel
Save