[Title] Change file path which is installmanager performance test result
authoryongsung1.kim <yongsung1.kim@samsung.com>
Mon, 5 Aug 2013 12:29:59 +0000 (21:29 +0900)
committeryongsung1.kim <yongsung1.kim@samsung.com>
Mon, 5 Aug 2013 12:29:59 +0000 (21:29 +0900)
file path from applocal/tizen-sdk-data to c:\tizen-sdk-data by default
on Windows.
[Desc.] If user change tizen-sdk-data path, result file path would be
changed also.
[Issue] redmine #10148

Change-Id: Iceef08abcd3c3933efcdf624e89405adfffbb28b

InstallManager_java/src/org/tizen/installmanager/cli/CliInstall.java
InstallManager_java/src/org/tizen/installmanager/core/InstallManager.java
InstallManager_java/src/org/tizen/installmanager/core/InstallManagerConstants.java
InstallManager_java/src/org/tizen/installmanager/core/Installer.java
InstallManager_java/src/org/tizen/installmanager/core/OptionConstant.java
InstallManager_java/src/org/tizen/installmanager/core/Performance.java
InstallManager_java/src/org/tizen/installmanager/lib/Registry.java

index fd8f55a..f1ca990 100644 (file)
@@ -90,7 +90,7 @@ public class CliInstall {
                PackageManager pm = PackageManager.getInstance();
                        
                String targetDir = getTargetDir();
-               Registry.sdkWorkSpacePath = getSDKDataPath();
+               Registry.sdkDataPath = getSDKDataPath();
                Config.USER_CONFIG_HOME_PATH = getSDKDataPath();
                
                PackageSet skipPackages = pm.getPackagesByNames(Options.skipPackages);
index 823b9e4..ee75987 100644 (file)
@@ -441,7 +441,7 @@ public class InstallManager {
         */
        private void setCurrentSDKEnvironment(String targetPath) {
                Log.log("Set new SDK environment from old SDK.");
-               Registry.sdkWorkSpacePath = Config.getConfigHome();
+               Registry.sdkDataPath = Config.getConfigHome();
                
                if (targetPath == null || targetPath.isEmpty()) {
                        Log.err("Install path is invalid: " + targetPath
index de99c59..9c9fdd9 100644 (file)
@@ -1,7 +1,35 @@
+/*
+*  InstallManager
+*
+* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+*
+* Contact: 
+* Donghee Yang <donghee.yang@samsung.com>
+* Shihyun Kim <shihyun.kim@samsung.com>
+* Yongsung kim <yongsung1.kim@samsung.com>
+* 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+* Contributors:
+* - S-Core Co., Ltd
+*
+*/ 
+
 package org.tizen.installmanager.core;
 
 import org.tizen.installmanager.lib.ErrorController.ErrorCode;
 import org.tizen.installmanager.lib.Platform;
+import org.tizen.installmanager.lib.Registry;
 import org.tizen.installmanager.util.PathUtil;
 
 public class InstallManagerConstants {
@@ -54,7 +82,15 @@ public class InstallManagerConstants {
                if (Platform.isLinux() || Platform.isMacOS()) {
                        return PathUtil.getFromHome(SDK_DATA_DIR_NAME);
                } else if (Platform.isWindows()) {
-                       return PathUtil.getFromAppData(SDK_DATA_DIR_NAME);
+                       if (Options.sdkDataPath.isEmpty() && Registry.sdkDataPath == "") {
+                               return WINDOWS_DEFAULT_DATA_PATH;                               
+                       } else if (!Options.sdkDataPath.isEmpty() && Registry.sdkDataPath == "") {
+                               return Options.sdkDataPath;
+                       } else if (Options.sdkDataPath.isEmpty() && Registry.sdkDataPath != "") {
+                               return Registry.sdkDataPath;
+                       } else {
+                               throw new IMFatalException(ErrorCode.FILE_NOT_FOUND);
+                       }
                } else {
                        throw new IMFatalException(ErrorCode.UNSUPPORTED_PLATFORM);
                }
index 6877163..636746f 100644 (file)
@@ -267,8 +267,8 @@ public class Installer {
                HashMap<String, String> env = new HashMap<String, String>();
 
                env.put("INSTALLED_PATH", Registry.getInstalledPath());
-               env.put("SDK_DATA_PATH", Registry.sdkWorkSpacePath);
-               env.put("USER_DATA_PATH", Registry.sdkWorkSpacePath);
+               env.put("SDK_DATA_PATH", Registry.sdkDataPath);
+               env.put("USER_DATA_PATH", Registry.sdkDataPath);
                env.put("MAKESHORTCUT_PATH", InstallManager.getInstance().getMakeShortCutPath());
                env.put("REMOVE_SHORTCUT", InstallManager.getInstance().getRemoveShortCutPath());
                env.put("TSUDO", InstallManager.getInstance().getTSudoPath());
index 5c5a7b2..492645a 100644 (file)
@@ -1,3 +1,30 @@
+/*
+*  InstallManager
+*
+* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+*
+* Contact: 
+* Donghee Yang <donghee.yang@samsung.com>
+* Shihyun Kim <shihyun.kim@samsung.com>
+* Yongsung kim <yongsung1.kim@samsung.com>
+* 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+* Contributors:
+* - S-Core Co., Ltd
+*
+*/ 
+
 package org.tizen.installmanager.core;
 
 public class OptionConstant {
index 24aede6..f9326aa 100644 (file)
@@ -1,3 +1,30 @@
+/*
+*  InstallManager
+*
+* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+*
+* Contact: 
+* Donghee Yang <donghee.yang@samsung.com>
+* Shihyun Kim <shihyun.kim@samsung.com>
+* Yongsung kim <yongsung1.kim@samsung.com>
+* 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+* Contributors:
+* - S-Core Co., Ltd
+*
+*/ 
+
 package org.tizen.installmanager.core;
 
 import java.io.BufferedWriter;
index 48903d7..35c5805 100644 (file)
@@ -74,7 +74,7 @@ public class Registry {
        private static final String REGISTRY_SEPERATOR = "=";
        
        public static String targetPath = "";
-       public static String sdkWorkSpacePath = "";
+       public static String sdkDataPath = "";
        private static ArrayList<String> sdkPathList = getSDKPath();
 
        /**
@@ -242,7 +242,7 @@ public class Registry {
        public static void setSDKinfoBySDKPath(String sdkPath) {
                File sdkInfoFile = new File(PathUtil.get(sdkPath, InstallManagerConstants.SDK_INFORMATION_FILE_NAME));
                if (sdkInfoFile.exists()) {
-                       sdkWorkSpacePath = getPathFromRegistryKey(sdkInfoFile.getAbsolutePath(), SDK_DATA_PATH_KEY);
+                       sdkDataPath = getPathFromRegistryKey(sdkInfoFile.getAbsolutePath(), SDK_DATA_PATH_KEY);
                        Log.log("sdk.info file exists. => " + sdkPath);
                        Log.log("InstallManager can set sdk environment.");
                } else {
@@ -451,7 +451,7 @@ public class Registry {
         */
        public static void saveSDKInfo(String installPath) {
                if (installPath == null || installPath.isEmpty() || 
-                               sdkWorkSpacePath == null || sdkWorkSpacePath.isEmpty()) {
+                               sdkDataPath == null || sdkDataPath.isEmpty()) {
                        Log.err("Install path or workspace path is invalid: " + installPath
                                        + ". This might be a bug of IM");
                        throw new IMFatalException(ErrorCode.INVALID_INSTALL_PATH);
@@ -459,7 +459,7 @@ public class Registry {
 
                String sdkInfoPath = PathUtil.get(installPath, InstallManagerConstants.SDK_INFORMATION_FILE_NAME);
                String target = INSTALLED_PATH_KEY + REGISTRY_SEPERATOR + installPath;
-               String workSpace = SDK_DATA_PATH_KEY + REGISTRY_SEPERATOR + sdkWorkSpacePath;
+               String workSpace = SDK_DATA_PATH_KEY + REGISTRY_SEPERATOR + sdkDataPath;
 
                File sdkInfoFile = null;
                try {