From 75156c299ce1f9fda74a2f3e4f3968c1edf2d0e6 Mon Sep 17 00:00:00 2001 From: Minkee Lee Date: Thu, 28 Jan 2016 21:06:18 +0900 Subject: [PATCH] backup-log: use a rename command when make a backup log A rename operation takes less time than copy. (A file copy takes long time if log file is very large and it causes emulator-manager and emulator start slowly) Change-Id: Ib60b131df38a6407a4762ea880a4098fd0c73923 Signed-off-by: Minkee Lee --- src/org/tizen/emulator/manager/vms/helper/VMLogUtil.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/org/tizen/emulator/manager/vms/helper/VMLogUtil.java b/src/org/tizen/emulator/manager/vms/helper/VMLogUtil.java index 5e9a8db..861f254 100644 --- a/src/org/tizen/emulator/manager/vms/helper/VMLogUtil.java +++ b/src/org/tizen/emulator/manager/vms/helper/VMLogUtil.java @@ -29,7 +29,6 @@ package org.tizen.emulator.manager.vms.helper; import java.io.File; -import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; @@ -71,9 +70,11 @@ public class VMLogUtil { Path target = makeBackupFilePath(source); try { - Files.copy(source, target, StandardCopyOption.REPLACE_EXISTING); - } catch (IOException e) { - EMLogger.getLogger().warning("Failed to make back log." ); //$NON-NLS-1$ + Files.move(source, target, StandardCopyOption.REPLACE_EXISTING); + } catch (Exception e) { + EMLogger.getLogger().warning("Failed to make back log. " //$NON-NLS-1$ + + e.getClass().getName() +", " + + e.getMessage()); } } -- 2.7.4