2013-07-03 sources upload
authordonghee yang <donghee.yang@samsung.com>
Wed, 3 Jul 2013 06:25:40 +0000 (15:25 +0900)
committerdonghee yang <donghee.yang@samsung.com>
Wed, 3 Jul 2013 06:25:40 +0000 (15:25 +0900)
Change-Id: I55b7a615e4fae2c34bc2ace7e2153d299732e436

139 files changed:
InstallManagerUpdater/src/org/tizen/installmanager/updater/InstallManagerUpdater.java [deleted file]
SdkImageCreator/README [deleted file]
SdkImageCreator/build.xml [deleted file]
SdkImageCreator/installmanager.conf [deleted file]
SdkImageCreator/lib/jarinjar.zip [deleted file]
SdkImageCreator/sic.sh [deleted file]
SdkImageCreator/src/org/tizen/installmanager/core/Config.java [deleted file]
SdkImageCreator/src/org/tizen/installmanager/core/DistributionController.java [deleted file]
SdkImageCreator/src/org/tizen/installmanager/core/IMExitException.java [deleted file]
SdkImageCreator/src/org/tizen/installmanager/core/IMFatalException.java [deleted file]
SdkImageCreator/src/org/tizen/installmanager/core/IMInstallCancelException.java [deleted file]
SdkImageCreator/src/org/tizen/installmanager/core/InstallManager.java [deleted file]
SdkImageCreator/src/org/tizen/installmanager/core/Installer.java [deleted file]
SdkImageCreator/src/org/tizen/installmanager/core/Options.java [deleted file]
SdkImageCreator/src/org/tizen/installmanager/core/SDKExtensionInfo.java [deleted file]
SdkImageCreator/src/org/tizen/installmanager/core/SnapshotLog.java [deleted file]
SdkImageCreator/src/org/tizen/installmanager/core/UpdateInstallManager.java [deleted file]
SdkImageCreator/src/org/tizen/installmanager/lib/Checksum.java [deleted file]
SdkImageCreator/src/org/tizen/installmanager/lib/Documents.java [deleted file]
SdkImageCreator/src/org/tizen/installmanager/lib/Downloader.java [deleted file]
SdkImageCreator/src/org/tizen/installmanager/lib/ErrorController.java [deleted file]
SdkImageCreator/src/org/tizen/installmanager/lib/IFileSystemInformation.java [deleted file]
SdkImageCreator/src/org/tizen/installmanager/lib/IIMProgressMonitor.java [deleted file]
SdkImageCreator/src/org/tizen/installmanager/lib/IMError.java [deleted file]
SdkImageCreator/src/org/tizen/installmanager/lib/Log.java [deleted file]
SdkImageCreator/src/org/tizen/installmanager/lib/LoggerShellParser.java [deleted file]
SdkImageCreator/src/org/tizen/installmanager/lib/NetworkProxy.java [deleted file]
SdkImageCreator/src/org/tizen/installmanager/lib/OldRegistry.java [deleted file]
SdkImageCreator/src/org/tizen/installmanager/lib/Platform.java [deleted file]
SdkImageCreator/src/org/tizen/installmanager/lib/ProgramController.java [deleted file]
SdkImageCreator/src/org/tizen/installmanager/lib/Registry.java [deleted file]
SdkImageCreator/src/org/tizen/installmanager/lib/SDKPackageFormat.java [deleted file]
SdkImageCreator/src/org/tizen/installmanager/lib/ShellParser.java [deleted file]
SdkImageCreator/src/org/tizen/installmanager/lib/StartMenu.java [deleted file]
SdkImageCreator/src/org/tizen/installmanager/lib/linux/LinuxFileSystemInfo.java [deleted file]
SdkImageCreator/src/org/tizen/installmanager/lib/linux/LinuxProgramController.java [deleted file]
SdkImageCreator/src/org/tizen/installmanager/lib/linux/LinuxSDKPackageFormat.java [deleted file]
SdkImageCreator/src/org/tizen/installmanager/lib/linux/LinuxShellInstalledListParser.java [deleted file]
SdkImageCreator/src/org/tizen/installmanager/lib/linux/LinuxShellRunningProgramParser.java [deleted file]
SdkImageCreator/src/org/tizen/installmanager/lib/mac/MacProgramController.java [deleted file]
SdkImageCreator/src/org/tizen/installmanager/lib/win/WindowsFileSystemInfo.java [deleted file]
SdkImageCreator/src/org/tizen/installmanager/lib/win/WindowsProgramController.java [deleted file]
SdkImageCreator/src/org/tizen/installmanager/lib/win/WindowsRegistry.java [deleted file]
SdkImageCreator/src/org/tizen/installmanager/lib/win/WindowsSDKPackageFormat.java [deleted file]
SdkImageCreator/src/org/tizen/installmanager/lib/win/WindowsShellRunningProgramParser.java [deleted file]
SdkImageCreator/src/org/tizen/installmanager/pkg/lib/PackageManager.java [deleted file]
SdkImageCreator/src/org/tizen/installmanager/pkg/lib/PropertyParser.java [deleted file]
SdkImageCreator/src/org/tizen/installmanager/pkg/lib/darwin/DarwinPackageManager.java [deleted file]
SdkImageCreator/src/org/tizen/installmanager/pkg/lib/linux/LinuxPackageManager.java [deleted file]
SdkImageCreator/src/org/tizen/installmanager/pkg/lib/win/WindowsPackageManager.java [deleted file]
SdkImageCreator/src/org/tizen/installmanager/pkg/model/ConfigFile.java [deleted file]
SdkImageCreator/src/org/tizen/installmanager/pkg/model/Distribution.java [deleted file]
SdkImageCreator/src/org/tizen/installmanager/pkg/model/DistributionSet.java [deleted file]
SdkImageCreator/src/org/tizen/installmanager/pkg/model/IMPackageNotFound.java [deleted file]
SdkImageCreator/src/org/tizen/installmanager/pkg/model/Package.java [deleted file]
SdkImageCreator/src/org/tizen/installmanager/pkg/model/PackageSet.java [deleted file]
SdkImageCreator/src/org/tizen/installmanager/pkg/model/Properties.java [deleted file]
SdkImageCreator/src/org/tizen/installmanager/pkg/model/Property.java [deleted file]
SdkImageCreator/src/org/tizen/installmanager/pkg/model/PropertySection.java [deleted file]
SdkImageCreator/src/org/tizen/installmanager/pkg/model/Snapshot.java [deleted file]
SdkImageCreator/src/org/tizen/installmanager/pkg/model/SnapshotList.java [deleted file]
SdkImageCreator/src/org/tizen/installmanager/pkg/model/Version.java [deleted file]
SdkImageCreator/src/org/tizen/installmanager/ui/InstallManagerWindow.java [deleted file]
SdkImageCreator/src/org/tizen/installmanager/ui/dialog/AddExtraDialog.java [deleted file]
SdkImageCreator/src/org/tizen/installmanager/ui/dialog/AddExtraRepositoryDialog.java [deleted file]
SdkImageCreator/src/org/tizen/installmanager/ui/dialog/ChangeServerDialog.java [deleted file]
SdkImageCreator/src/org/tizen/installmanager/ui/dialog/ConfigurationDialog.java [deleted file]
SdkImageCreator/src/org/tizen/installmanager/ui/dialog/IndeterminateProgressDialog.java [deleted file]
SdkImageCreator/src/org/tizen/installmanager/ui/dialog/LoginDlg.java [deleted file]
SdkImageCreator/src/org/tizen/installmanager/ui/dialog/MessageBoxDlg.java [deleted file]
SdkImageCreator/src/org/tizen/installmanager/ui/dialog/SnapshotLogDialog.java [deleted file]
SdkImageCreator/src/org/tizen/installmanager/ui/model/Item.java [deleted file]
SdkImageCreator/src/org/tizen/installmanager/ui/model/ItemLabelProvider.java [deleted file]
SdkImageCreator/src/org/tizen/installmanager/ui/model/ItemTreeContentProvider.java [deleted file]
SdkImageCreator/src/org/tizen/installmanager/ui/page/.gitignore [deleted file]
SdkImageCreator/src/org/tizen/installmanager/ui/page/CompletePage.java [deleted file]
SdkImageCreator/src/org/tizen/installmanager/ui/page/ConfigPathPage.java [deleted file]
SdkImageCreator/src/org/tizen/installmanager/ui/page/InstallableListPage.java [deleted file]
SdkImageCreator/src/org/tizen/installmanager/ui/page/InstallingPage.java [deleted file]
SdkImageCreator/src/org/tizen/installmanager/ui/page/LicensePage.java [deleted file]
SdkImageCreator/src/org/tizen/installmanager/ui/page/PackageListPage.java [deleted file]
SdkImageCreator/src/org/tizen/installmanager/ui/page/SetInstallDirectoryPage.java [deleted file]
SdkImageCreator/src/org/tizen/installmanager/ui/page/UninstallableListPage.java [deleted file]
SdkImageCreator/src/org/tizen/installmanager/ui/page/UninstallingPage.java [deleted file]
SdkImageCreator/src/org/tizen/installmanager/ui/page/UpdatableListPage.java [deleted file]
SdkImageCreator/src/org/tizen/installmanager/ui/page/ViewController.java [deleted file]
SdkImageCreator/src/org/tizen/installmanager/ui/page/WelcomePage.java [deleted file]
SdkImageCreator/src/org/tizen/installmanager/util/IMShellCommandFail.java [deleted file]
SdkImageCreator/src/org/tizen/installmanager/util/PathUtil.java [deleted file]
SdkImageCreator/src/org/tizen/installmanager/util/ShellUtil.java [deleted file]
SdkImageCreator/src/res/COPYING [deleted file]
SdkImageCreator/src/res/desktop_directory/ExecuteInstallManager.vbs [deleted file]
SdkImageCreator/src/res/desktop_directory/checkJavaInstallation.sh [deleted file]
SdkImageCreator/src/res/desktop_directory/checkRunningTaskList.vbs [deleted file]
SdkImageCreator/src/res/desktop_directory/install.sh [deleted file]
SdkImageCreator/src/res/desktop_directory/install.vbs [deleted file]
SdkImageCreator/src/res/desktop_directory/makeshortcut.sh [deleted file]
SdkImageCreator/src/res/desktop_directory/makeshortcut.vbs [deleted file]
SdkImageCreator/src/res/desktop_directory/remove.sh [deleted file]
SdkImageCreator/src/res/desktop_directory/remove.vbs [deleted file]
SdkImageCreator/src/res/desktop_directory/removeOldSDK.sh [deleted file]
SdkImageCreator/src/res/desktop_directory/removeOldSDK.vbs [deleted file]
SdkImageCreator/src/res/desktop_directory/removeshortcut.sh [deleted file]
SdkImageCreator/src/res/desktop_directory/removeshortcut.vbs [deleted file]
SdkImageCreator/src/res/desktop_directory/tizen-sdk-installmanager.ico [deleted file]
SdkImageCreator/src/res/desktop_directory/tizen-sdk-installmanager.png [deleted file]
SdkImageCreator/src/res/desktop_directory/tizen-sdk-menu.directory [deleted file]
SdkImageCreator/src/res/desktop_directory/tizen-sdk-menu.ico [deleted file]
SdkImageCreator/src/res/desktop_directory/tizen-sdk-menu.png [deleted file]
SdkImageCreator/src/res/icons/SDK_icon.png [deleted file]
SdkImageCreator/src/res/icons/icon_directory_open.png [deleted file]
SdkImageCreator/src/res/icons/icon_error.png [deleted file]
SdkImageCreator/src/res/icons/icon_loading.png [deleted file]
SdkImageCreator/src/res/icons/icon_login.png [deleted file]
SdkImageCreator/src/res/icons/icon_messages.png [deleted file]
SdkImageCreator/src/res/icons/icon_notify.png [deleted file]
SdkImageCreator/src/res/icons/icon_permission.png [deleted file]
SdkImageCreator/src/res/icons/icon_repositories.png [deleted file]
SdkImageCreator/src/res/icons/icon_warning.png [deleted file]
SdkImageCreator/src/res/images/install_manager_graphicmotif_001.png [deleted file]
SdkImageCreator/src/res/images/install_manager_graphicmotif_002.png [deleted file]
SdkImageCreator/src/res/images/install_manager_graphicmotif_003.png [deleted file]
SdkImageCreator/src/res/images/install_manager_graphicmotif_004.png [deleted file]
SdkImageCreator/src/res/images/install_manager_graphicmotif_welcome.png [deleted file]
SdkImageCreator/src/res/images/uninstaller_graphicmotif_001.png [deleted file]
SdkImageCreator/src/res/images/uninstaller_graphicmotif_002.png [deleted file]
SdkImageCreator/src/res/images/uninstaller_graphicmotif_003.png [deleted file]
SdkImageCreator/src/res/installmanager/buildversion [deleted file]
SdkImageCreator/src/res/installmanager/removetizentemp.bat [deleted file]
UpdateInstallManager/.project [deleted file]
UpdateInstallManager/.settings/org.eclipse.jdt.core.prefs [deleted file]
UpdateInstallManager/src/org/tizen/installmanager/updater/InstallManagerUpdater.java [deleted file]
UpdateInstallManager/src/org/tizen/installmanager/updater/PathUtil.java [deleted file]
unittest/.project [deleted file]
unittest/.settings/org.eclipse.jdt.core.prefs [deleted file]
unittest/src/com/samsung/installmanager/tests/InstallManagerTest.java [deleted file]
unittest/src/com/samsung/installmanager/tests/Packages_repo.list [deleted file]
unittest/src/com/samsung/installmanager/tests/installedpackage.list [deleted file]
unittest/src/org/tizen/installmanager/util/TestResourceHandler.java [deleted file]

diff --git a/InstallManagerUpdater/src/org/tizen/installmanager/updater/InstallManagerUpdater.java b/InstallManagerUpdater/src/org/tizen/installmanager/updater/InstallManagerUpdater.java
deleted file mode 100644 (file)
index 2d643d0..0000000
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
-*  InstallManager
-*
-* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
-*
-* Contact: 
-* Wooyoung Cho <wooyoung1.cho@samsung.com>
-* Shihyun Kim <shihyun.kim@samsung.com>
-* Taeyoung Son <taeyoung2.son@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.updater;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.PrintWriter;
-
-public class InstallManagerUpdater {
-       private static PrintWriter writer;
-       
-       private static void initWriter() {
-               try {
-                       writer = new PrintWriter(new File(System.getProperty("user.dir") + 
-                                       File.separator +"updater.log"));
-               } catch (FileNotFoundException e) {
-                       e.printStackTrace();
-               }
-       }
-       
-       public boolean moveFile(String from, String to) {
-               return moveFile(new File(from), new File(to));
-       }
-       
-       public boolean moveFile(File from, File to) {
-               writer.println("Move " + from + " to " + to);
-               if (!from.exists()) {
-                       writer.println("File not found: "+from);
-                       return false;
-               } else {} //nothing
-               
-               if (to.exists()) {
-                       writer.println("File exists. try to delete : "+to);
-                       if(to.delete()) {
-                               writer.println("deleted");
-                       } else {
-                               writer.println("delete fail");
-                               return false;
-                       }
-               } else {}
-               
-               return from.renameTo(to);
-       }
-       
-       /**
-        * Moves new IM to old IM and run the IM.
-        * @param args args[0] is path of new IM. args[1] is path of old IM.
-        */
-       public static void main(String[] args) {
-               initWriter();
-               
-               if (args.length < 2) {
-                       return;
-               }
-               
-               try {
-                       writer.println("sleep 3000");
-                       Thread.sleep(3000);
-               } catch (InterruptedException e) {
-                       // TODO Auto-generated catch block
-                       e.printStackTrace();
-               }
-               
-               String[] imargs = new String[args.length-2];
-               for(int i = 0; i < args.length-2; i++) {
-                       imargs[i] = args[i+2];
-               }
-               
-               InstallManagerUpdater upInstallManager = new InstallManagerUpdater();
-               upInstallManager.update(args[0], args[1], imargs);
-       }
-       
-       private void update(String newIM, String oldIM, String[] imargs) {
-               boolean bResult = moveFile(newIM, oldIM);
-               String imarg = "";
-               for(String a : imargs) {
-                       imarg = imarg + " " + a;
-               }
-               
-               if (bResult){
-                       writer.println("move success");
-                       try {
-                               File toFile = new File(oldIM);
-                               toFile.setExecutable(true);
-                               writer.println("run IM");
-                               Runtime.getRuntime().exec("java -jar " + toFile.getAbsolutePath() + " -updated " + imarg);
-                       } catch (IOException e) {
-                               writer.println("run failed");
-                               // TODO Auto-generated catch block
-                               e.printStackTrace();
-                       }
-               } else {
-                       writer.println("move failed");
-               }
-               writer.close();
-       }
-
-}
diff --git a/SdkImageCreator/README b/SdkImageCreator/README
deleted file mode 100644 (file)
index 6f2624b..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-How to build and use in Eclipse
-- Add jar files in lib directory to classpath
-- Use appropriate SWT jar file depending on your platform
-- Copy one of installmanager.conf.* to installmanager.conf depending on your platform 
-
diff --git a/SdkImageCreator/build.xml b/SdkImageCreator/build.xml
deleted file mode 100644 (file)
index 1666834..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-<project name="InstallManager" default="dist" basedir=".">
-       <description>
-         Install Manager for Tizen SDK
-    </description>
-
-       <!-- set global properties for this build -->
-       <property name="src.dir" location="src"/>
-       <property name="build.dir" location="build"/>
-       <property name="lib.dir" location="lib"/>
-       <property name="dist.dir"  location="dist"/>
-       <property name="jarinjar"  value="${lib.dir}/jarinjar.zip"/>
-       <property name="is-windows" value="true"/>
-
-       <target name="init-windows" if="is-windows">
-               <property name="swtjar" value="org.eclipse.swt.win32.win32.x86_3.6.2.v3659c.jar"/>
-               <property name="PLATFORM" value="windows"/>
-       </target>
-       <target name="init-linux" if="is-linux">
-               <property name="swtjar" value="org.eclipse.swt.gtk.linux.x86_3.6.2.v3659b.jar"/>
-               <property name="PLATFORM" value="linux"/>
-       </target>
-       <target name="init-windows-64" if="is-windows">
-               <property name="swtjar" value="swt-win32-64.jar"/>
-               <property name="PLATFORM" value="windows64"/>
-       </target>
-       <target name="init-linux-64" if="is-linux">
-               <property name="swtjar" value="swt-linux-64.jar"/>
-               <property name="PLATFORM" value="linux64"/>
-       </target>
-
-       <target name="init" depends="init-linux,init-windows,init-linux-64,init-windows-64">
-               <property name="distlib.dir"  value="${dist.dir}/${PLATFORM}/InstallManager_lib"/>
-               <path id="build-classpath">
-                       <fileset dir="${basedir}/lib">
-                               <include name="*.jar"/>
-                       </fileset>
-               </path>
-               <mkdir dir="${build.dir}"/>
-               <mkdir dir="${dist.dir}"/>
-               <mkdir dir="${dist.dir}/${PLATFORM}"/>
-               <mkdir dir="${distlib.dir}"/>
-       </target>
-
-       <target name="compile" depends="init" description="compile the source" >
-               <javac srcdir="${src.dir}" destdir="${build.dir}" debug="on" debuglevel="source,lines,vars">
-                       <classpath refid="build-classpath"/>
-               </javac>
-       </target>
-
-       <target name="dist" depends="compile" description="generate the distribution">
-               <copy file="${basedir}/lib/org.eclipse.equinox.common_3.6.0.v20100503.jar" todir="${distlib.dir}" />
-               <copy file="${basedir}/lib/org.eclipse.jface_3.6.2.M20110210-1200.jar" todir="${distlib.dir}" />
-               <copy file="${basedir}/lib/org.eclipse.core.commands_3.6.0.I20100512-1500.jar" todir="${distlib.dir}" />
-               <copy file="${basedir}/lib/${swtjar}" todir="${distlib.dir}" />
-
-               <jar jarfile="${dist.dir}/${PLATFORM}/InstallManager.jar">
-                       <fileset dir="${build.dir}" />
-                       <fileset dir="${src.dir}" includes="res/**"/>
-                       <fileset dir="${distlib.dir}"/>
-                       <zipfileset src="${jarinjar}"/> 
-                       <manifest>
-                               <attribute name="Rsrc-Class-Path" value="./ org.eclipse.equinox.common_3.6.0.v20100503.jar
-                               org.eclipse.core.commands_3.6.0.I20100512-1500.jar 
-                               org.eclipse.jface_3.6.2.M20110210-1200.jar
-                               ${swtjar}"/>
-                               <attribute name="Class-Path" value="."/>
-                               <attribute name="Rsrc-Main-Class" value="org.tizen.installmanager.ui.InstallManagerWindow"/>
-                               <attribute name="Main-Class" value="org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader"/>
-                       </manifest>
-    </jar>
-       </target>
-
-                       <target name="clean" description="clean up" >
-                               <delete dir="${build.dir}"/>
-                               <delete dir="${dist.dir}"/>
-                               <delete dir="${distlib.dir}"/>
-                       </target>
-
-               </project>
diff --git a/SdkImageCreator/installmanager.conf b/SdkImageCreator/installmanager.conf
deleted file mode 100644 (file)
index 62e57ae..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-Repository: http://172.21.17.55/packages
-InstallManager-Repository: 
-Type: 
-Package-Server: 
-Server-Type: snapshot
-InstallManager-Version: 2.0.5
-Distribution: release
-Release-note: https://developer.tizen.org
-
diff --git a/SdkImageCreator/lib/jarinjar.zip b/SdkImageCreator/lib/jarinjar.zip
deleted file mode 100644 (file)
index 8fcca7c..0000000
Binary files a/SdkImageCreator/lib/jarinjar.zip and /dev/null differ
diff --git a/SdkImageCreator/sic.sh b/SdkImageCreator/sic.sh
deleted file mode 100755 (executable)
index a00ecf3..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-#!/bin/sh
-
-TPUT="`which tput`"
-if test -t 0 -a -t 1 -a -n "$TPUT"; then
-        CI="`$TPUT setf 6 || true`"; CE="`$TPUT setf 4 || true`"
-        CX="`$TPUT setf 2 || true`"; CN="`$TPUT sgr0 || true`"
-else    CI=''; CE=''; CX=''; CN=''
-fi
-
-echo "$CX******************************$CN"
-echo "$CX**  SDK Image Creator v1.0  **$CN"
-echo "$CX******************************$CN"
-
-### 1. check argument ###
-if [ $# != 6 ]; then
-        echo "$CE usage : ./sic.sh <package server> <distribution> <platform> <bit> <boundary:all/public/partner> <SDKImage> $CN"
-        echo "$CE ex) ./sic.sh tizendev.org release linux 32 partner Ubuntu32SDKImage $CN"
-        exit 1
-else
-       echo "1. Success to input argument. Start making SDK image."
-fi
-
-### 2. set argument ###
-echo "2. Set argument"
-CUR_DIR=`pwd`
-targetServer=$1
-distribution=$2
-platform=$3
-bit=$4
-boundary=$5
-targetImageName=$6
-
-sdkImage=${targetImageName}_*.zip
-sicBinary="sic.jar"
-
-### 3. Set installmanager.conf ###
-echo "3. Set installmanager.conf"
-## set config file variable
-configFile="installmanager.conf"
-repository=http://${targetServer}/packages
-serverType="snapshot"
-
-## clear workspace(remove installmanager.conf if exists.)
-echo "- Clear workspace(remove installmanager.conf if exists.)"
-if [ -e ${configFile} ]
-then
-  rm ${configFile}
-else
-  echo "- ${configFile} file not found. workspace clear."
-fi
-
-## create config file
-echo "- Create config file."
-echo "Repository: "${repository} >> ${configFile}
-echo "Server-Type: "${serverType} >> ${configFile}
-echo "Distribution: "${distribution} >> ${configFile}
-
-### 4. Make SDK Image ###
-echo "4. Make SDK Image"
-## download packages to './binary/*'
-echo "- Download packages to './binary/* "
-java -jar ${sicBinary} -onlyDownload ${boundary} ${platform} ${bit}
-
-currentDate=`date '+%Y%m%d%H%M'`
-
-zip -r $6_${currentDate} binary/ pkg_list*
-
-echo "exitcode="$?
-
-rm pkg_list*
-
-if [ $? -eq 0 ]
-then
-       rm -rf binary
-fi
-
-### 5. Finish work and Cleare workspace ###
-echo "5. Finish work and Cleare workspace."
-rm installmanager.conf
-exit 0
diff --git a/SdkImageCreator/src/org/tizen/installmanager/core/Config.java b/SdkImageCreator/src/org/tizen/installmanager/core/Config.java
deleted file mode 100644 (file)
index e64bb35..0000000
+++ /dev/null
@@ -1,597 +0,0 @@
-/*\r
- *  InstallManager\r
- *\r
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.\r
- *\r
- * Contact: \r
- * Wooyoung Cho <wooyoung1.cho@samsung.com>\r
- * Shihyun Kim <shihyun.kim@samsung.com>\r
- * Taeyoung Son <taeyoung2.son@samsung.com>\r
- * Yongsung kim <yongsung1.kim@samsung.com>\r
- * \r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- *\r
- * Contributors:\r
- * - S-Core Co., Ltd\r
- *\r
- */\r
-\r
-package org.tizen.installmanager.core;\r
-\r
-import java.io.File;\r
-import java.io.IOException;\r
-import java.util.Arrays;\r
-import java.util.Collection;\r
-import java.util.Collections;\r
-import org.tizen.installmanager.core.IMFatalException;\r
-import org.tizen.installmanager.lib.ErrorController.ErrorCode;\r
-import org.tizen.installmanager.lib.Log;\r
-import org.tizen.installmanager.lib.Platform;\r
-import org.tizen.installmanager.pkg.model.ConfigFile;\r
-import org.tizen.installmanager.pkg.model.Version;\r
-import org.tizen.installmanager.util.PathUtil;\r
-\r
-/**\r
- * This class manages to configure installmanager.\r
- * \r
- * @author shihyun kim <Shihyun.kim@samsung.com>\r
- * \r
- */\r
-public class Config {\r
-       public static final String SDK_NAME = "Tizen SDK";\r
-\r
-       // Directory and Execute file name.\r
-       public static final String INSTALL_MANAGER_FILE_NAME = "InstallManager";\r
-       public static final String INSTALL_MANAGER_DIRECTORY = "install-manager";\r
-       public static final String OLD_INSTALL_MANAGER_DIRECTORY = "InstallManager";\r
-       public static final String INSTALL_MANAGER_BINARY = "InstallManager.jar";\r
-       public static final String INSTALL_MANAGER_UPDATER_BINARY = "InstallManagerUpdater.jar";\r
-       public static final String EXECUTE_FILE_NAME_OF_INSTALL_MANAGER = getExecuteFileNameOfInstallManager();\r
-       public static final String EXECUTE_FILE_NAME_OF_INSTALL_MANAGER_PARTNER = \r
-                       getExecuteFileNameOfInstallManagerPartner();\r
-       public static final String EXECUTE_FILE_PATH_OF_INSTALL_MANAGER = PathUtil\r
-                       .get(INSTALL_MANAGER_DIRECTORY,\r
-                                       EXECUTE_FILE_NAME_OF_INSTALL_MANAGER);\r
-       public static final String SDK_DIRECTORY = "tizen-sdk";\r
-\r
-       // config File\r
-       public static final String CONFIG_DIRECTORY_NAME = "tizen-sdk-data";\r
-       public static final String CONFIG_HOME = getConfigHome();\r
-       public static final String INFO_DIRECTORY = ".info";\r
-       \r
-       public static final String OLD_CONFIG_DIRECTORY_NAME = ".TizenSDK";\r
-       public static final String OLD_CONFIG_HOME = getOldConfigHome();\r
-       // public static final String INFO_DIRECTORY_PATH =\r
-       // PathUtil.getFromInstalledPath(INFO_DIRECTORY);\r
-\r
-       // old config File\r
-       public static final String OLD_INFO_DIRECTORY = "info";\r
-       public static final String OLD_INFO_DIRECTORY_PATH = PathUtil.get(\r
-                       CONFIG_HOME, OLD_INFO_DIRECTORY);\r
-       public static final String OLD_INFO_REMOVESCRIPT_DIRECTORY = "removescript";\r
-       public static final String OLD_INFO_REMOVESCRIPT_PATH = PathUtil.get(\r
-                       OLD_INFO_DIRECTORY_PATH, OLD_INFO_REMOVESCRIPT_DIRECTORY);\r
-       public static final String OLD_INSTALLED_FILE_LIST_DIRECTORY = "installedlist";\r
-       public static final String OLD_INSTALLED_FILE_LIST_DIRECTORY_PATH = PathUtil\r
-                       .get(OLD_INFO_DIRECTORY_PATH, OLD_INSTALLED_FILE_LIST_DIRECTORY);\r
-\r
-       // IM config file.\r
-       public static final String INSTALL_MANAGER_DEFAULT_CONFIG_FILE_NAME = "installmanager.conf";\r
-       public static final String INSTALL_MANAGER_DEFAULT_CONFIG_FILE_PATH = PathUtil\r
-                       .get(INSTALL_MANAGER_DIRECTORY,\r
-                                       INSTALL_MANAGER_DEFAULT_CONFIG_FILE_NAME);\r
-\r
-       // Programs shortcut path\r
-       public static final String SDK_PROGRAMS_SHORTCUT_MENU_PATH = getSLPSDKShortcutPath();\r
-       public static final String SDK_PROGRAMS_SHORTCUT_MENU_FILENAME = "tizen-sdk-menu.directory";\r
-       public static final String SDK_PROGRAMS_SHORTCUT_MENU_ICON_PATH = PathUtil\r
-                       .getFromHome(".local/share/icons/tizen-sdk-menu.png");\r
-\r
-       // InstallManager Shortcut PathUtil\r
-       public static final String SHORTCUT_DIRECTORY = "Tizen SDK";\r
-       public static final String INSTALL_MANAGER_SHORTCUT = "InstallManager";\r
-       public static final String INSTALL_MANAGER_SHORTCUT_PATH = getInstallManagerShortcutPath();\r
-       public static final String INSTALL_MANAGER_SHORTCUT_FILENAME = "tizen-sdk-installmanager.desktop";\r
-       public static final String INSTALL_MANAGER_SHORTCUT_ICON_PATH = getInstallManagerShortcutIconPath();\r
-\r
-       // OLD SHORTCUT\r
-       public static final String OLD_SHORTCUT_DIRECTORY = "Samsung Linux Platform";\r
-       public static final String OLD_SDK_PROGRAMS_SHORTCUT_MENU_PATH = getOldSLPSDKShortcutPath();\r
-       public static final String OLD_SDK_PROGRAMS_SHORTCUT_MENU_FILENAME = "samsung-sdk_menu.directory";\r
-       public static final String OLD_SDK_PROGRAMS_SHORTCUT_MENU_ICON_PATH = PathUtil\r
-                       .getFromHome(".local/share/icons/samsung-sdk-menu.ico");\r
-\r
-       public static final String OLD_INSTALL_MANAGER_SHORTCUT_PATH = PathUtil\r
-                       .getFromHome(".local/share/applications/samsung-sdk-installmanager.desktop");\r
-       public static final String OLD_INSTALL_MANAGER_SHORTCUT_FILENAME = "samsung-sdk-installmanager.desktop";\r
-       public static final String OLD_INSTALL_MANAGER_SHORTCUT_ICON_PATH = PathUtil\r
-                       .getFromHome(".local/share/icons/samsung-sdk-installmanager.ico");\r
-\r
-       // Packages info\r
-       public static final String BINARY_DIRECTORY = "binary";\r
-       public static final String PACKAGE_LIST_FILE_LINUX_32 = "pkg_list_ubuntu-32";\r
-       public static final String PACKAGE_LIST_FILE_LINUX_64 = "pkg_list_ubuntu-64";\r
-       public static final String PACKAGE_LIST_FILE_WINDOWS_32 = "pkg_list_windows-32";\r
-       public static final String PACKAGE_LIST_FILE_WINDOWS_64 = "pkg_list_windows-64";\r
-       public static final String PACKAGE_LIST_FILE_MACOS_64 = "pkg_list_macos-64";\r
-       public static final String PACKAGE_BINARY_LOCAL_DIRECTORY_PATH = PathUtil\r
-                       .getFromCurrDir(Config.BINARY_DIRECTORY);\r
-       public static final String PACKAGE_LIST_LOCAL_DIRECTORY_PATH = PathUtil\r
-                       .getCurrentDir();\r
-//     public static String PACKAGE_LIST_FILE_PATH = ""; // path includes pkg list file name by using configuration dialog.\r
-//     public static String PACKAGE_LIST_FILE_DIR = ""; // path excepts pkg list file name by using configuration dialog.\r
-       public static final String INSTALLED_PACKAGE_LIST_FILE_NAME = "installedpackage.list";\r
-//     public static String SDK_IMAGE_PATH = "";\r
-\r
-       // Install temp directory\r
-       public static final String TEMP_DIRECTORY = "temp";\r
-       public static final String DATA_DIRECTORY = "data";\r
-       public static final String SDK_TEMP_DIR = "tizensdk";\r
-       public static final String SDK_TEMP_DIR_PATH = PathUtil.getFromTempDir(Config.SDK_TEMP_DIR);\r
-\r
-       // batch file\r
-       public static final String INSTALL_MANAGER_REMOVE_BATCH_SCRIPT_FILE_NAME = "removeSDKDirectory.bat";\r
-       public static final String INSTALL_MANAGER_REMOVE_VB_SCRIPT_FILE_NAME = "removeSDKDirectory.vbs";\r
-\r
-       // repository\r
-       public static final String REPOSITORY_DISTRIBUTION_INFO_FILE = "distribution.info";\r
-       public static final String REPOSITORY_SNAPSHOT_INFO_FILE = "snapshot.info";\r
-       public static final String REPOSITORY_DEFAULT_TYPE = "develop";\r
-       \r
-       private String localRepository = "";\r
-       private String confFilePath = null;\r
-       \r
-       // configuration dialog\r
-       public static ConfDialog fromWhere = ConfDialog.NORMAL; // where does information come from in configuration dialog.\r
-       \r
-       private ServerType serverType = ServerType.SNAPSHOT;\r
-       public static Status status = Status.INSTALL;\r
-       \r
-       /**\r
-        * This enumeration where does information come from in configuration dialog.</br>\r
-        * NORMAL is just push 'next' button.</br>\r
-        * SNAPSHOT is information from snapshot table in configuration dialog.</br>\r
-        * LOCAL_IMAGE is information from file dialog in configuration dialog.</br>\r
-        * USER_SPECIFIC is information from text editor in configuration dialog.</br>\r
-        */\r
-       public enum ConfDialog {\r
-               NORMAL, SNAPSHOT, LOCAL_IMAGE, USER_SPECIFIC;\r
-       }\r
-       \r
-       public enum Status {\r
-               INSTALL, UPDATE, UNINSTALL;\r
-       }\r
-       \r
-       public enum ServerType{\r
-               SNAPSHOT("snapshot"),\r
-               PACKAGE("package"),\r
-               LOCAL("local"); \r
-               \r
-               private String type = "";\r
-               ServerType(String type){\r
-                       this.type = type;\r
-               }\r
-               \r
-               public String toString() {\r
-                       return type;\r
-               }\r
-       }\r
-\r
-       // exit codes of Install Manager\r
-       public static final int EXITCODE_NORMAL = 0;\r
-       public static final int EXITCODE_HAS_SELF_UPDATE = 1;\r
-       public static final int EXITCODE_DEP_ERROR = 2;\r
-       public static final int EXITCODE_ONLY_DOWNLOAD = 3;\r
-       public static final int EXITCODE_UNKNOWN_ERROR = 4;\r
-\r
-       // release note file\r
-       public static final String RELEASE_NOTE = "release-note.txt";\r
-       private ConfigFile mConfigFile = null;\r
-       private String mTargetDir = "";\r
-\r
-       private static Config config = null;\r
-\r
-       private Config() {\r
-               confFilePath = getConfigFilePath();\r
-               mConfigFile = new ConfigFile(confFilePath);\r
-       }\r
-\r
-       /**\r
-        * @return filename of install manager executable\r
-        */\r
-       private static String getExecuteFileNameOfInstallManager() {\r
-               if (Platform.isLinux() || Platform.isMacOS() ) {\r
-                       return "InstallManager";                                \r
-               } else if ( Platform.isWindows() ) {\r
-                       return "InstManager.exe";\r
-               } else {\r
-                       throw new IMFatalException(ErrorCode.UNSUPPORTED_PLATFORM);\r
-               }\r
-       }\r
-       \r
-       /**\r
-        * @return filename of install manager executable for Partner SDK\r
-        */\r
-       private static String getExecuteFileNameOfInstallManagerPartner() {\r
-               if (Platform.isLinux() || Platform.isMacOS() ) {\r
-                       return "InstallManagerP";                               \r
-               } else if ( Platform.isWindows() ) {\r
-                       return "InstManager.exe";\r
-               } else {\r
-                       throw new IMFatalException(ErrorCode.UNSUPPORTED_PLATFORM);\r
-               }\r
-       }\r
-\r
-       private static String getInstallManagerShortcutPath() {\r
-               if (Platform.isUbuntu()) {\r
-                       return PathUtil.getFromHome(".local/share/applications/"\r
-                                       + Config.INSTALL_MANAGER_SHORTCUT_FILENAME);\r
-               } else if (Platform.isWindows()) {\r
-                       return "";\r
-               } else if (Platform.isMacOS()) {\r
-                       return "";\r
-               } else {\r
-                       throw new IMFatalException(ErrorCode.UNSUPPORTED_PLATFORM);\r
-               }\r
-       }\r
-\r
-       private static String getInstallManagerShortcutIconPath() {\r
-               if (Platform.isUbuntu()) {\r
-                       return PathUtil\r
-                                       .getFromHome(".local/share/icons/tizen-sdk-installmanager.png");\r
-               } else if (Platform.isWindows()) {\r
-                       return "";\r
-               } else if (Platform.isMacOS()) {\r
-                       return "";\r
-               }\r
-               else {\r
-                       throw new IMFatalException(ErrorCode.UNSUPPORTED_PLATFORM);\r
-               }\r
-       }\r
-\r
-       public static String getConfigHome() {\r
-               if (Platform.isLinux() || Platform.isMacOS()) {\r
-                       return PathUtil.getFromHome(Config.CONFIG_DIRECTORY_NAME);\r
-               } else if (Platform.isWindows()) {\r
-                       return PathUtil.getFromAppData(Config.CONFIG_DIRECTORY_NAME);\r
-               } else {\r
-                       throw new IMFatalException(ErrorCode.UNSUPPORTED_PLATFORM);\r
-               }\r
-       }\r
-       \r
-       public static String getOldConfigHome() {\r
-               if (Platform.isLinux() || Platform.isMacOS()) {\r
-                       return PathUtil.getFromHome(Config.OLD_CONFIG_DIRECTORY_NAME);\r
-               } else if (Platform.isWindows()) {\r
-                       return PathUtil.getFromAppData(Config.OLD_CONFIG_DIRECTORY_NAME);\r
-               } else {\r
-                       throw new IMFatalException(ErrorCode.UNSUPPORTED_PLATFORM);\r
-               }\r
-       }\r
-\r
-       private static String getSLPSDKShortcutPath() {\r
-               if (Platform.isUbuntu()) {\r
-                       return PathUtil.getFromHome(".local/share/desktop-directories/"\r
-                                       + Config.SDK_PROGRAMS_SHORTCUT_MENU_FILENAME);\r
-               } else if (Platform.isWindows()) {\r
-                       return Config.SHORTCUT_DIRECTORY;\r
-               } else if (Platform.isMacOS()) {\r
-                       return "";\r
-               } else {\r
-                       throw new IMFatalException(ErrorCode.UNSUPPORTED_PLATFORM);\r
-               }\r
-       }\r
-\r
-       private static String getOldSLPSDKShortcutPath() {\r
-               if (Platform.CURRENT_PLATFORM == Platform.LINUX_32) {\r
-                       return PathUtil\r
-                                       .getFromHome(".local/share/desktop-directories/samsung-sdk_menu.directory");\r
-               } else if (Platform.CURRENT_PLATFORM == Platform.WINDOWS_32) {\r
-                       return Config.OLD_SHORTCUT_DIRECTORY;\r
-               } else {\r
-                       return "";\r
-               }\r
-       }\r
-\r
-       /**\r
-        * Set target directory to member variable.\r
-        * \r
-        * @param targetDir\r
-        */\r
-       public void setTargetDir(String targetDir) {\r
-               mTargetDir = targetDir;\r
-       }\r
-\r
-       /**\r
-        * Get ConfigFile Class instance\r
-        * \r
-        * @return\r
-        */\r
-       public ConfigFile getConfigFile() {\r
-               return mConfigFile;\r
-       }\r
-\r
-       private String[] getSDKRepositories() {\r
-               String repo = mConfigFile.getRepository();\r
-\r
-               String[] repos = repo.split(",");\r
-\r
-               for (int i=0; i<repos.length; i++) {\r
-                       repos[i] = repos[i].trim();\r
-               }\r
-\r
-               return repos;\r
-       }\r
-       \r
-       /**\r
-        * Get repositories of SDK.\r
-        * \r
-        * @return string array.\r
-        */\r
-       public Collection<String> getSDKRepositoryList() {\r
-               String[] repos = getSDKRepositories();\r
-               \r
-               return Arrays.asList(repos);\r
-       }\r
-       \r
-       /**\r
-        * Set snapshot path from repository.\r
-        * @return\r
-        */\r
-       public String getSnapshotPath() {\r
-               return mConfigFile.getSnapshotPath();\r
-       }\r
-       \r
-       /**\r
-        * Set snapshot path from repository.\r
-        * @param snapshotPath if <code>snapshotPath</code> is empty(""), always update latest version.\r
-        */\r
-       public void setSnapshotPath(String snapshotPath) {\r
-               mConfigFile.setSnapshotPath(snapshotPath);\r
-       }\r
-       \r
-       /**\r
-        * Always update latest version.\r
-        */\r
-       public void setLatestSnapshotPath() {\r
-               mConfigFile.setSnapshotPath("");\r
-       }\r
-       \r
-       /**\r
-        * Get repositories.\r
-        * \r
-        * @return List of packgae repositories.\r
-        */\r
-       public Collection<String> getSDKPackageServerList() {\r
-               if (serverType == ServerType.SNAPSHOT) {\r
-                       String[] repos = getSDKRepositories();\r
-                       \r
-                       if (repos.length <= 0) {\r
-                               return Collections.emptyList();\r
-                       }\r
-                       \r
-                       for (int i=0; i<repos.length; i++) {\r
-                               repos[i] = addDistribution(repos[i]);\r
-                       }\r
-                       \r
-                       return Arrays.asList(repos);\r
-               } else {\r
-                       String[] repos = {localRepository};\r
-                       \r
-                       return Arrays.asList(repos);\r
-               }\r
-       }\r
-       \r
-       public ServerType getServerType() {\r
-               return serverType;\r
-       }\r
-       \r
-       public String getReleaseNoteUrl() {\r
-               return mConfigFile.getReleaseNoteUrl();\r
-       }\r
-       \r
-       private String addDistribution(String repository) {\r
-               if (repository == null || repository.isEmpty()) {\r
-                       return null;\r
-               }\r
-\r
-               //server type\r
-               String distribution = mConfigFile.getDistribution();\r
-               \r
-               //if distribution is empty, add default distribution.\r
-               if (distribution == null || distribution.isEmpty()) {\r
-                       return PathUtil.addURLPath(repository, Config.REPOSITORY_DEFAULT_TYPE);\r
-                       \r
-                       //else if serv\r
-               } else {\r
-                       return PathUtil.addURLPath(repository, distribution);\r
-               }\r
-       }\r
-       /**\r
-        * Set information of server.\r
-        * @param repository Base-repository of sdk. if repository is null, it do not set repository.\r
-        * @param distribution distribution of repository. if distribution is null, it do not set type.\r
-        * @param packageServer package server of sdk. if packageServer is null, it do not set packageServer.\r
-        * @param serverType if serverType is null, it do not set serverType.\r
-        */\r
-       public void saveConfiguration(String repository, String distribution, ServerType serverType, String snapshotPath) {                             \r
-               if (serverType != null) {\r
-                       this.serverType = serverType;\r
-                       \r
-                       if (serverType == ServerType.SNAPSHOT) {\r
-                               if (repository != null && !repository.isEmpty()) {\r
-                                       mConfigFile.setRepository(repository);\r
-                               }\r
-                               \r
-                               mConfigFile.setSnapshotPath(snapshotPath);\r
-                       } else {\r
-                               File repositoryFile = new File(repository);\r
-                               \r
-                               if (repositoryFile.exists()) {\r
-                                               this.localRepository = repositoryFile.toURI().toString();\r
-                               }\r
-                       }\r
-               }\r
-               \r
-               if (distribution != null && !distribution.isEmpty()) {\r
-                       mConfigFile.setDistribution(distribution);\r
-               }\r
-               \r
-               saveConfig();\r
-       }\r
-       \r
-       public void setServerType(ServerType serverType) {\r
-               this.serverType = serverType;\r
-       }\r
-       \r
-       /**\r
-        * Set type of repository.\r
-        * @param type\r
-        */\r
-       public void setRepositoryType(String type) {\r
-               mConfigFile.setDistribution(type);\r
-       }\r
-\r
-       /**\r
-        * Create configuration directory.\r
-        * \r
-        * @return\r
-        */\r
-       public boolean makeConfigHome() {\r
-               boolean bResult = true;\r
-\r
-               File configHomeDirFile = new File(Config.CONFIG_HOME);\r
-               if (!configHomeDirFile.exists()) {\r
-                       bResult = configHomeDirFile.mkdirs();\r
-               }\r
-\r
-               if (bResult) {\r
-                       try {\r
-                               PathUtil.makeHiddenFile(configHomeDirFile);\r
-                               return true;\r
-                       } catch (IOException e) {\r
-                               Log.ExceptionLog(e);\r
-                               return false;\r
-                       }\r
-               } else {\r
-                       return false;\r
-               }\r
-       }\r
-\r
-       /**\r
-        * Make information directory. It can be used for installmanager.\r
-        * \r
-        * @return <code>true</true> if success.\r
-        */\r
-       public boolean makeInfoDirectory() {\r
-\r
-               boolean bResult = makeConfigHome();\r
-\r
-               if (bResult) {\r
-                       File configDirFile = new File(\r
-                                       PathUtil.getFromInstalledPath(Config.INFO_DIRECTORY));\r
-                       configDirFile.mkdir();\r
-               } else {\r
-                       return false;\r
-               }\r
-\r
-               return bResult;\r
-       }\r
-\r
-       /**\r
-        * @return path of target directory\r
-        */\r
-       public String getTargetDir() {\r
-               return mTargetDir;\r
-       }\r
-\r
-       /**\r
-        * @return <code>true</code> if proxy server is specified\r
-        */\r
-       public boolean hasProxy() {\r
-               if (mConfigFile != null) {\r
-                       String server = mConfigFile.getProxyServer();\r
-                       int port = mConfigFile.getProxyPort();\r
-                       if (server.equals("") || port < 0) {\r
-                               return false;\r
-                       }\r
-               }\r
-               return true;\r
-       }\r
-\r
-       /**\r
-        * @return version of install manager\r
-        */\r
-       public Version getInstallManagerVersion() {\r
-               return new Version(this.mConfigFile.getInstallManagerVersion());\r
-       }\r
-\r
-       /**\r
-        * @return Config file Path when installer is recognize install\r
-        *         option(-conf).\r
-        */\r
-       public static String getConfigFilePath() {\r
-               //user config option is false. \r
-               if (Options.userConfPath == null) {\r
-                       //1st, get config file from installed path.\r
-                       File installedConfFile = new File(PathUtil.getFromInstalledPath(Config.INSTALL_MANAGER_DEFAULT_CONFIG_FILE_NAME));\r
-                       if (installedConfFile.exists()) {\r
-                               return installedConfFile.getAbsolutePath();\r
-                               \r
-                       //if not exist config file from installed path, 2nd get config file from current directory. \r
-                       } else {\r
-                               File currentDirConfFile = new File(PathUtil.getFromCurrDir(Config.INSTALL_MANAGER_DEFAULT_CONFIG_FILE_NAME));\r
-                               \r
-                               if (currentDirConfFile.exists()) {\r
-                                       return currentDirConfFile.getAbsolutePath();\r
-                               } else {\r
-                                       return null;\r
-                               }\r
-                       }\r
-                       \r
-               //user config option is true,\r
-               } else {\r
-                       return Options.userConfPath;\r
-               }\r
-       }\r
-\r
-       /**\r
-        * save config file to TargetDirectory\r
-        */\r
-       public void saveConfig() {\r
-               if (confFilePath == null || confFilePath.isEmpty()) {\r
-                       return;\r
-               } else {\r
-                       mConfigFile.saveConfig(confFilePath);\r
-               }\r
-       }\r
-\r
-       /**\r
-        * Reads build version from resource which will be generated\r
-        * \r
-        * @return build version\r
-        */\r
-       public static String getJarBuildVersion() {\r
-               String buildversion = PathUtil\r
-                               .readAllTextFromResource("/res/installmanager/buildversion");\r
-               return buildversion;\r
-       }\r
-\r
-       public static Config getInstance() {\r
-               if (config == null) {\r
-                       config = new Config();\r
-               }\r
-               \r
-               return config;\r
-       }\r
-}\r
diff --git a/SdkImageCreator/src/org/tizen/installmanager/core/DistributionController.java b/SdkImageCreator/src/org/tizen/installmanager/core/DistributionController.java
deleted file mode 100644 (file)
index 18566eb..0000000
+++ /dev/null
@@ -1,369 +0,0 @@
-/*
- *  InstallManager
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: 
- * Wooyoung Cho <wooyoung1.cho@samsung.com>
- * Shihyun Kim <shihyun.kim@samsung.com>
- * Taeyoung Son <taeyoung2.son@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.File;
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-
-import org.tizen.installmanager.lib.Downloader;
-import org.tizen.installmanager.lib.Log;
-import org.tizen.installmanager.pkg.lib.PropertyParser;
-import org.tizen.installmanager.pkg.model.Distribution;
-import org.tizen.installmanager.pkg.model.DistributionSet;
-import org.tizen.installmanager.pkg.model.PropertySection;
-import org.tizen.installmanager.pkg.model.Snapshot;
-import org.tizen.installmanager.pkg.model.SnapshotList;
-import org.tizen.installmanager.util.PathUtil;
-
-/**
- * This class manages to distribution.
- * 
- * @author shihyun kim <Shihyun.kim@samsung.com>
- * 
- */
-public class DistributionController {  
-       private static DistributionController distController = null;
-       
-       private String MARKED_SNAPSHOT = "manual";
-       
-       //distributino information
-       DistributionSet dists = new DistributionSet();
-       
-       Collection<String> repositories = null;
-       HashMap<String, SnapshotList> distributionSnapshotSet = new HashMap<String, SnapshotList>();
-       
-       private DistributionController(Collection<String> repos) {
-               repositories = repos;
-       }
-       
-       /**
-        * initialize distribution.
-        * @return if <code>false</code>, can not read any distribuion.
-        */
-       public boolean init() {         
-               if (!dists.isEmpty()) {
-                       dists.clear();
-               }
-               
-               loadDistribution();
-               
-               if (dists.isEmpty()) {
-                       return false;
-               } else {
-                       for (Distribution dist : dists) {
-                               loadSnapshot(dist);
-                       }
-                       return true;
-               }
-       }
-       
-       /**
-        * Get distribution list in repository.
-        * @return
-        */
-       public List<String> getDistributionList() {             
-               List<String> distList = new ArrayList<String>();
-               for (Distribution dist : dists) {
-                       if (dist.getName() != null) {
-                               distList.add(dist.getName());                           
-                       }
-               }
-               
-               return distList;
-       }
-       
-       /**
-        * Load distribution from repository.
-        */
-       public void loadDistribution() {
-               if (!dists.isEmpty()) {
-                       dists.clear();
-               }
-               
-               File tmp = null;
-               try {
-                       tmp = File.createTempFile("dist", ".info");
-                       tmp.deleteOnExit();
-               } catch (IOException e) {
-                       Log.ExceptionLog(e);
-                       return;
-               }
-                                                                                                                            
-               //download dist.info file from repository
-               Downloader downloader = new Downloader();
-               
-               for (String repo : repositories) {
-                       URL distInfoFileURL = getDistInfoFilePath(repo);
-                       
-                       long size = downloader.download(distInfoFileURL, tmp.getAbsolutePath(), null);
-                       if (size < 0) {
-                               return;
-                       }
-                       
-                       //parsing dist.list file.
-                       PropertyParser parser = new PropertyParser();
-                       List<PropertySection> sections = parser.readFromFile(tmp);
-                       
-                       if (sections == null) {
-                               return;
-                       }
-                       
-                       for (PropertySection section : sections) {
-                               dists.add(new Distribution(repo, section.getProperties()));
-                       }
-                       
-                       // temp file cleanup
-                       if (tmp.exists()) {
-                               tmp.delete();
-                       }
-               }
-       }
-       
-       private URL getDistInfoFilePath(String repo) {
-               String distInfoFilePath = PathUtil.addURLPath(repo, Config.REPOSITORY_DISTRIBUTION_INFO_FILE);
-               
-               try {
-                       return new URL(distInfoFilePath);
-               } catch (MalformedURLException e) {
-                       Log.err("Cannot connect distribution file in repository(" + distInfoFilePath + ")");
-                       return null;
-               }
-       }
-       
-       /**
-        * Get all of snapshots.
-        * @return
-        */
-       public SnapshotList getSnapshotList(String distribution) {
-               SnapshotList list = distributionSnapshotSet.get(distribution);           
-               
-               if (list == null) {
-                       return SnapshotList.EMPTY;
-               } else {
-                       return list;
-               }
-       }
-       
-       /**
-        * Get manual snapshot list.
-        * @param distribution
-        * @return
-        */
-       public SnapshotList getManualSnapshotList(String distribution) {
-               SnapshotList manualSnapshotList = new SnapshotList();
-               
-               SnapshotList snapshotList = getSnapshotList(distribution);
-               
-               for(Snapshot snapshot : snapshotList) {
-                       if (snapshot.getType().equals(MARKED_SNAPSHOT)) {
-                               manualSnapshotList.add(snapshot);
-                       }
-               }
-               
-               return manualSnapshotList;
-       }
-       
-       /**
-        * Load snapshot information from repository.
-        * @param distribution selected distribution.
-        * @return SnapshotList
-        */
-       public void loadSnapshot(String distribution) {
-               Distribution dist = dists.getDistributionByName(distribution);
-               loadSnapshot(dist);
-       }
-       /**
-        * Load snapshot information from repository.
-        * @param distribution selected distribution.
-        * @return
-        */
-       private void loadSnapshot(Distribution distribution) {          
-               if (distribution == null) {
-                       return;
-               } else {
-                       String snapshotRepo = PathUtil.addURLPath(distribution.getRepository(), distribution.getName());
-                       SnapshotList list = loadSnapshotFromRepository(snapshotRepo);
-                       
-                       //sort by date.
-                       Collections.sort(list);
-                       
-                       //read snapshots and save to distributionSnapshotSet instance. 
-                       //If you read snapshots next, you can find in distributionSnapshotSet instance.
-                       distributionSnapshotSet.put(distribution.getName(), list);
-               }
-       }
-       
-       /**
-        * Load snapshot information from repository.
-        * @param repository package repository.
-        */
-       private SnapshotList loadSnapshotFromRepository(String snapshotRepo) {
-               SnapshotList snapshots = new SnapshotList();
-               
-               File tmp = null;
-               
-               try {
-                       tmp = File.createTempFile("snapshot", ".info");
-                       tmp.deleteOnExit();
-               } catch (IOException e) {
-                       Log.ExceptionLog(e);
-                       return SnapshotList.EMPTY;
-               }
-                                                                                                                            
-               //download snapshot.list file from repository
-               Downloader downloader = new Downloader();
-               URL snapshotListURL = getSnapshotListPathInRepository(snapshotRepo);
-               
-               long size = downloader.download(snapshotListURL, tmp.getAbsolutePath(), null);
-               if (size < 0) {
-                       Log.err("Fail to download snapshot.info from repository.");
-                       return SnapshotList.EMPTY;
-               }
-               
-               //parsing snapshot.list file.
-               PropertyParser parser = new PropertyParser();
-               List<PropertySection> sections = parser.readFromFile(tmp);
-               
-               if (sections == null) {
-                       return SnapshotList.EMPTY;
-               }
-               
-               if (Options.allSnapshots) {
-                       // for showing all snapshots.
-                       for (PropertySection section : sections) {
-                               snapshots.add(new Snapshot(section.getProperties()));                           
-                       } 
-               } else {
-                       // for showing filtered snapshots.
-                       for (PropertySection section : sections) {
-                               Snapshot s = new Snapshot(section.getProperties());
-                               snapshots.add(s);
-                       }
-               }
-               
-               return snapshots;
-       }
-       
-       private URL getSnapshotListPathInRepository(String snapshotRepo) {
-               if (snapshotRepo == null || snapshotRepo.isEmpty()) {
-                       Log.log("Repository for snapshot do not exist.");
-                       return null;
-                       
-               } else {
-                       String snapshotListPath = PathUtil.addURLPath(snapshotRepo, Config.REPOSITORY_SNAPSHOT_INFO_FILE);
-                       try {
-                               Log.log("Snapshot.list url is " + snapshotListPath);
-                               return new URL(snapshotListPath);
-                       } catch (MalformedURLException e) {
-                               Log.ExceptionLog(e);
-                               return null;
-                       }
-               }
-       }
-       
-       /**
-        * Filter snapshot list of distribution.
-        * @param distribution distribution for snapshot
-        * @return
-        */
-       public SnapshotList filterSnapshotByDistribution(String distribution) {         
-               SnapshotList snapshots = distributionSnapshotSet.get(distribution);
-               
-               if (snapshots == null) {
-                       return SnapshotList.EMPTY;
-               } else {
-                       return snapshots;
-               }
-       }
-       
-       /**
-        * Get latest snapshot in distribution.
-        * @param distribution
-        * @return Snapshot.
-        */
-       public Snapshot getLatestSnapshot(String distribution) {
-               Snapshot latestSnapshot = null;
-               
-               SnapshotList snapshotList = getSnapshotList(distribution);
-               if (!snapshotList.isEmpty()) {
-                       latestSnapshot = getSnapshotList(distribution).get(0);                   
-               } else {
-                       Log.err("There are not snapshots in distribution. : " + distribution);
-                       return null;
-               }
-               
-               Log.log("The latest snapshot name: " + latestSnapshot.getName());               
-               return latestSnapshot;
-       }
-       
-       public Collection<String> getRepositories() {
-               return repositories;
-       }
-       
-       /**
-        * Get DistributionController instance.
-        * @param repository
-        * @return
-        */
-       public static DistributionController getInstance(Collection<String> repositories) {
-               if (distController == null || !distController.getRepositories().containsAll(repositories)) {
-                       distController = new DistributionController(repositories);
-               }
-               
-               return distController;
-       }
-       
-       /**
-        * Get DistributionController instance.
-        * @param repository
-        * @return
-        */
-       public static DistributionController getInstance(String repo) {
-               Collection<String> repositories = new ArrayList<String>();
-               repositories.add(repo);
-               
-               return getInstance(repositories);
-       }
-       
-       /**
-        * Get DistributionController instance.
-        * @param repository
-        * @return if null, instance is not created.
-        */
-       public static DistributionController getInstance(){
-               return distController;
-       }
-}
diff --git a/SdkImageCreator/src/org/tizen/installmanager/core/IMExitException.java b/SdkImageCreator/src/org/tizen/installmanager/core/IMExitException.java
deleted file mode 100644 (file)
index 0b05461..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- *  InstallManager
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: 
- * Wooyoung Cho <wooyoung1.cho@samsung.com>
- * Shihyun Kim <shihyun.kim@samsung.com>
- * Taeyoung Son <taeyoung2.son@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;
-
-/**
- * Thrown when IM needs to exit immediately and gracefully
- * 
- * @author Wooyoung Cho <wooyoung1.cho@samsung.com>
- * 
- */
-public class IMExitException extends Exception {
-       private static final long serialVersionUID = -6412113539194703737L;
-
-       /**
-        * @param exitCode
-        */
-       public IMExitException(int exitCode) {
-               ErrorController.setExitCode(exitCode);
-       }
-}
diff --git a/SdkImageCreator/src/org/tizen/installmanager/core/IMFatalException.java b/SdkImageCreator/src/org/tizen/installmanager/core/IMFatalException.java
deleted file mode 100644 (file)
index 5335a9c..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
-*  InstallManager
-*
-* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
-*
-* Contact: 
-* Wooyoung Cho <wooyoung1.cho@samsung.com>
-* Shihyun Kim <shihyun.kim@samsung.com>
-* Taeyoung Son <taeyoung2.son@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;
-import org.tizen.installmanager.lib.Log;
-import org.tizen.installmanager.lib.ErrorController.ErrorCode;
-
-/**
- * This exception is thrown when fatal error occurs.
- * 
- * @author Wooyoung Cho <wooyoung1.cho@samsung.com>
- *
- */
-public class IMFatalException extends RuntimeException {
-
-       private String msg;
-
-       public IMFatalException(String msg) {
-               Log.err(msg);
-               this.msg = msg;
-               ErrorController.setErrorMessage(msg);
-       }
-       
-       public IMFatalException(ErrorCode e) {
-               this.msg = ErrorController.getMessage(e);
-               Log.err(msg);
-               
-               ErrorController.setError(e);
-       }
-       
-       public String getMessage() {
-               return msg;
-       }
-
-       private static final long serialVersionUID = 756412192330085351L;
-       
-}
diff --git a/SdkImageCreator/src/org/tizen/installmanager/core/IMInstallCancelException.java b/SdkImageCreator/src/org/tizen/installmanager/core/IMInstallCancelException.java
deleted file mode 100644 (file)
index 0fa44a5..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
-*  InstallManager
-*
-* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
-*
-* Contact: 
-* Wooyoung Cho <wooyoung1.cho@samsung.com>
-* Shihyun Kim <shihyun.kim@samsung.com>
-* Taeyoung Son <taeyoung2.son@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;
-
-/**
- * This exception is thrown when user cancels the installation
- * @author Wooyoung Cho <wooyoung1.cho@samsung.com>
- *
- */
-public class IMInstallCancelException extends RuntimeException {
-
-       private static final long serialVersionUID = 3148263859401585847L;
-
-}
diff --git a/SdkImageCreator/src/org/tizen/installmanager/core/InstallManager.java b/SdkImageCreator/src/org/tizen/installmanager/core/InstallManager.java
deleted file mode 100644 (file)
index 43d0b08..0000000
+++ /dev/null
@@ -1,1258 +0,0 @@
-/*
- *  InstallManager
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: 
- * Wooyoung Cho <wooyoung1.cho@samsung.com>
- * Shihyun Kim <shihyun.kim@samsung.com>
- * Taeyoung Son <taeyoung2.son@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.File;
-import java.io.FilenameFilter;
-import java.io.IOException;
-import java.net.URL;
-import java.security.MessageDigest;
-import java.util.ArrayList;
-import java.util.Collection;
-
-import org.tizen.installmanager.lib.Checksum;
-import org.tizen.installmanager.lib.Downloader;
-import org.tizen.installmanager.lib.ErrorController;
-import org.tizen.installmanager.lib.IIMProgressMonitor;
-import org.tizen.installmanager.lib.Log;
-import org.tizen.installmanager.lib.Platform;
-import org.tizen.installmanager.lib.Registry;
-import org.tizen.installmanager.lib.StartMenu;
-import org.tizen.installmanager.lib.ErrorController.ErrorCode;
-import org.tizen.installmanager.lib.win.WindowsProgramController;
-import org.tizen.installmanager.pkg.lib.PackageManager;
-import org.tizen.installmanager.pkg.model.Package;
-import org.tizen.installmanager.pkg.model.PackageSet;
-import org.tizen.installmanager.ui.page.InstallingPage.InstallProgressMonitor;
-import org.tizen.installmanager.util.IMShellCommandFail;
-import org.tizen.installmanager.util.PathUtil;
-
-/**
- * This class contains the main business logic of Install Manager. Use singleton
- * instance.
- * 
- * @author Shihyun Kim <shihyun.kim@samsung.com>
- */
-public class InstallManager {
-
-       private static final InstallManager mInstallManager = new InstallManager();
-
-       private Config mConfig = null;
-       private static Downloader mDownloader = new Downloader();
-       private PackageManager packageManager;
-
-       // windows path
-       private static String WINDOWS_INSTALL_MANAGER_INSTALL_SCRIPT = "/res/desktop_directory/install.vbs";
-       private static String WINDOWS_INSTALL_MANAGER_REMOVE_SCRIPT = "/res/desktop_directory/remove.vbs";
-       private static String WINDOWS_MAKE_SHORTCUT_PATH = "/res/desktop_directory/makeshortcut.vbs";
-       private static String WINDOWS_REMOVE_SHORTCUT_PATH = "/res/desktop_directory/removeshortcut.vbs";
-
-       // linux script
-       private static String LINUX_INSTALL_MANAGER_INSTALL_SCRIPT = "/res/desktop_directory/install.sh";
-       private static String LINUX_INSTALL_MANAGER_REMOVE_SCRIPT = "/res/desktop_directory/remove.sh";
-       private static String LINUX_MAKE_SHORTCUT_PATH = "/res/desktop_directory/makeshortcut.sh";
-       private static String LINUX_REMOVE_SHORTCUT_PATH = "/res/desktop_directory/removeshortcut.sh";
-
-       private File makeShortCutFile = null;
-       private File removeShortCutFile = null;
-
-       private InstallManager() {
-       }
-
-       /**
-        * @return singleton instance of <code>InstallManager</code>
-        */
-       public static InstallManager getInstance() {
-               return mInstallManager;
-       }
-
-       /**
-        * Load config file
-        */
-       public void initConfig() {
-               if (mConfig != null) {
-                       return;
-               } else {
-                       mConfig = Config.getInstance();
-
-                       if (Options.doReplaceRepository) {
-                               Log.log("Replace repository => " + Options.repo);
-                               mConfig.getConfigFile().setRepository(Options.repo);
-                               mConfig.saveConfig();
-                       }
-
-                       if (mConfig.getConfigFile() == null) {
-                               Log.log("Loading config file failed");
-                               throw new IMFatalException("Loading configuration file failed");
-                       }
-
-                       if (!Registry.getInstalledPath().isEmpty()) {
-                               mConfig.setTargetDir(Registry.getInstalledPath());
-                       }
-               }
-       }
-       
-       /**
-        * Initialize packages information.
-        */
-       public void initPackageList() {
-               Collection<String> repositoryURLs = mConfig.getSDKPackageServerList();
-
-               initPackageManager(repositoryURLs);
-       }
-
-       private void initPackageManager(Collection<String> repositoryURLs) {
-
-               File installedPackageListFile = new File(PathUtil.get(
-                               PathUtil.getFromInstalledPath(Config.INFO_DIRECTORY),
-                               Config.INSTALLED_PACKAGE_LIST_FILE_NAME));
-               try {
-                       if (installedPackageListFile.exists()) {
-                               this.packageManager = PackageManager.getInstance(installedPackageListFile, repositoryURLs);
-                       } else {
-                               this.packageManager = PackageManager.getInstance(null, repositoryURLs);
-                       }
-               } catch (IOException e) {
-                       Log.err("Cannot load package manager =>" + installedPackageListFile
-                                       + ", " + repositoryURLs);
-                       throw new IMFatalException(ErrorCode.CANNOT_CREATE_FILE);
-               }
-       }
-       
-       /**
-        * Initialize distribution and snapshot information
-        */
-       public boolean initDistribution() {
-               DistributionController controller = 
-                       DistributionController.getInstance(mConfig.getSDKRepositoryList());
-       
-               return controller.init();
-       }
-       
-       
-       /**
-        * Initialize installmanager. It performs that read config file, make
-        * temporary files and load package list from repository.
-        * 
-        * @return <code>true</code> if initialize success to install or uninstall.
-        */
-       public void init() {
-               initConfig();
-               
-               initDistribution();
-               initPackageList();
-               initConfigurationFile();
-               checkOldSDK();
-       }
-       
-       private void initConfigurationFile() {
-               copyMakeShortCutFile();
-               copyRemoveShortCutFile();
-       }
-
-       /**
-        * Delete temporary files related installmanager.
-        */
-       public static void deleteTempFile() {
-
-               File tmpDir = new File(PathUtil.getTempFileParent());
-               File[] tmpFiles = tmpDir.listFiles(new FilenameFilter() {
-                       @Override
-                       public boolean accept(File dir, String name) {
-                               boolean found = false;
-                               String[] prefix = { "makeshortcut", "removeshortcut",
-                                               "installmanager.repository", "Packages",
-                                               "tizen_installmanager", "checkJavaInstallation",
-                                               "install" };
-                               for (String pref : prefix) {
-                                       found = name.startsWith(pref);
-                                       if (found == true) {
-                                               return true;
-                                       }
-                               }
-                               return found;
-                       }
-               });
-
-               for (File f : tmpFiles) {
-                       f.delete();
-               }
-       }
-
-       /**
-        * Copy make shortcut file from resource to temp directory.
-        */
-       private void copyMakeShortCutFile() {
-               try {
-                       if (Platform.CURRENT_PLATFORM == Platform.LINUX_32
-                                       || Platform.CURRENT_PLATFORM == Platform.LINUX_64) {
-                               makeShortCutFile = PathUtil.getTempFileFromResource(
-                                               LINUX_MAKE_SHORTCUT_PATH, "makeshortcut", ".sh");
-                       } else if (Platform.CURRENT_PLATFORM == Platform.WINDOWS_32
-                                       || Platform.CURRENT_PLATFORM == Platform.WINDOWS_64) {
-                               makeShortCutFile = PathUtil.getTempFileFromResource(
-                                               WINDOWS_MAKE_SHORTCUT_PATH, "makeshortcut", ".vbs");
-                       } else if (Platform.CURRENT_PLATFORM == Platform.MACOS_64) {
-                               makeShortCutFile = PathUtil.getTempFileFromResource(
-                                               LINUX_MAKE_SHORTCUT_PATH, "makeshortcut", ".sh");
-                       } else {
-                               throw new IMFatalException(ErrorCode.UNSUPPORTED_PLATFORM);
-                       }
-                       
-                       if (makeShortCutFile.exists()) {
-                               makeShortCutFile.setExecutable(true);
-                       }
-               } catch (IOException e) {
-                       Log.err("Installer cannot make 'makeshortcut script' file.");
-                       throw new IMFatalException(ErrorCode.CANNOT_CREATE_SHORTCUT);
-               }
-       }
-
-       /**
-        * Copy remove shortcut file from resource to temp directory.
-        */
-       private void copyRemoveShortCutFile() {
-               try {
-                       if (Platform.CURRENT_PLATFORM == Platform.LINUX_32
-                                       || Platform.CURRENT_PLATFORM == Platform.LINUX_64) {
-                               removeShortCutFile = PathUtil.getTempFileFromResource(
-                                               LINUX_REMOVE_SHORTCUT_PATH, "removeshortcut", ".sh");
-                       } else if (Platform.CURRENT_PLATFORM == Platform.WINDOWS_32
-                                       || Platform.CURRENT_PLATFORM == Platform.WINDOWS_64) {
-                               removeShortCutFile = PathUtil.getTempFileFromResource(
-                                               WINDOWS_REMOVE_SHORTCUT_PATH, "removeshortcut", ".vbs");
-                       } else if (Platform.CURRENT_PLATFORM == Platform.MACOS_64) {
-                               removeShortCutFile = PathUtil.getTempFileFromResource(
-                                               LINUX_REMOVE_SHORTCUT_PATH, "removeshortcut", ".sh");
-                       } else {
-                               throw new IMFatalException(ErrorCode.UNSUPPORTED_PLATFORM);
-                       }
-                       removeShortCutFile.setExecutable(true);
-               } catch (IOException e) {
-                       Log.err("Installer cannot make 'makeshortcut script' file.");
-                       throw new IMFatalException(ErrorCode.CANNOT_CREATE_SHORTCUT);
-               }
-       }
-
-       /**
-        * get make shortcut File instance.
-        * 
-        * @return File instance of makeshortcut script.
-        */
-       public File getMakeShortCut() {
-               return makeShortCutFile;
-       }
-
-       /**
-        * Get temporary file path.(makeshortcut script, Packages list, Installer
-        * log)
-        * 
-        * @return temporary file path, if not exist makeshortcut file, return empty
-        *         string.
-        */
-       public String getMakeShortCutPath() {
-               if (getMakeShortCut() == null) {
-                       return "";
-               } else {
-                       return getMakeShortCut().getAbsolutePath();
-               }
-       }
-
-       /**
-        * Get temporary file path.(rmoveshortcut script, Packages list, Installer
-        * log)
-        * 
-        * @return temporary file path, if not exist removeshortcut file, return
-        *         emptry string.
-        */
-       public String getRemoveShortCutPath() {
-               if (getRemoveShortCut() == null) {
-                       return "";
-               } else {
-                       return getRemoveShortCut().getAbsolutePath();
-               }
-       }
-
-       /**
-        * Get remove shortcut File instance.
-        * 
-        * @return File instance of removeshortcut script.
-        */
-       public File getRemoveShortCut() {
-               return removeShortCutFile;
-       }
-
-       /**
-        * Get Config instance
-        * 
-        * @return
-        */
-       public Config getConfig() {
-               return mConfig;
-       }
-
-       /**
-        * Get PackageManager instance.
-        * 
-        * @return
-        */
-       public PackageManager getPackageManager() {
-               return packageManager;
-       }
-       
-       private void checkOldSDK() {
-               if (Registry.getInstalledPath() == null
-                               || Registry.getInstalledPath().isEmpty()) {
-                       return;
-               }
-
-               File oldInfoDir = new File(Config.OLD_INFO_DIRECTORY_PATH);
-
-               if (oldInfoDir.exists()) {
-                       moveOldInfoDirToCurrentInfoDir(oldInfoDir);
-               } else {
-                       return;
-               }
-       }
-
-       private void moveOldInfoDirToCurrentInfoDir(File oldInfoDir) {
-               File currentInfoDir = new File(
-                               PathUtil.getFromInstalledPath(Config.INFO_DIRECTORY));
-               if (!currentInfoDir.exists()) {
-                       currentInfoDir.mkdirs();
-               }
-
-               File oldInstalledList = new File(PathUtil.get(
-                               Config.OLD_INFO_DIRECTORY_PATH,
-                               Config.INSTALLED_PACKAGE_LIST_FILE_NAME));
-
-               if (oldInstalledList.exists()) {
-                       File currentInstalledList = new File(PathUtil.get(
-                                       PathUtil.getFromInstalledPath(Config.INFO_DIRECTORY),
-                                       Config.INSTALLED_PACKAGE_LIST_FILE_NAME));
-                       PathUtil.move(oldInstalledList, currentInstalledList);
-               } else {
-                       return;
-               }
-
-               File[] oldPackageDir = new File(Config.OLD_INFO_REMOVESCRIPT_PATH)
-                               .listFiles();
-               for (File childFile : oldPackageDir) {
-                       File currentPackageDir = new File(PathUtil.get(
-                                       PathUtil.getFromInstalledPath(Config.INFO_DIRECTORY),
-                                       childFile.getName()));
-
-                       File parentDir = currentPackageDir.getParentFile();
-                       if (!parentDir.exists()) {
-                               parentDir.mkdirs();
-                       }
-
-                       PathUtil.move(childFile, currentPackageDir);
-               }
-
-               File[] oldInstalledFileList = new File(
-                               Config.OLD_INSTALLED_FILE_LIST_DIRECTORY_PATH).listFiles();
-               for (File childFile : oldInstalledFileList) {
-                       File currentInstalledFile = new File(PathUtil.get(PathUtil
-                                       .getFromInstalledPath(Config.INFO_DIRECTORY), PathUtil
-                                       .getFileNameWithOutExtension(childFile.getAbsolutePath()),
-                                       childFile.getName()));
-
-                       File parentDir = currentInstalledFile.getParentFile();
-                       if (!parentDir.exists()) {
-                               parentDir.mkdirs();
-                       }
-
-                       PathUtil.move(childFile, currentInstalledFile);
-               }
-
-               PathUtil.remove(oldInfoDir);
-       }
-
-       /**
-        * Download packages
-        * 
-        * @param packagesToDownload
-        *            Set of packages to download
-        * @param monitor
-        * @return <code>true</code> if download success.
-        * @throws IMExitException
-        */
-       public boolean downloadPackages(PackageSet downloadPkgSet,
-                       InstallProgressMonitor monitor) throws IMExitException {
-               Log.log("InstallManager download start => " + downloadPkgSet);
-
-               long totalSize = 0;
-               for (Package pkg : downloadPkgSet) {
-                       totalSize += pkg.getPackageSize();
-               }
-
-               if (monitor != null) {
-                       int total = (int) (totalSize / 1024);
-                       monitor.beginTask("", total);
-               }
-
-               for (Package pkg : downloadPkgSet) {
-
-                       if (monitor != null) {
-                               monitor.setPackageName(pkg.getPackageName());
-                       }
-
-                       if (monitor != null && monitor.isCanceled()) {
-                               Log.log("download canceled");
-                               throw new IMInstallCancelException();
-                       }
-
-                       String fileName = pkg.getFileName();
-                       boolean downloadResult = downloadPackage(pkg, PathUtil.getFromCurrDir(fileName), monitor);
-
-                       if (!downloadResult) {
-                               Log.err("InstallManager download fail => " + pkg);
-                               return false;
-                       }
-               }
-
-               if (monitor != null) {
-                       monitor.workedProgressbar(100);
-               }
-
-               return true;
-       }
-
-       /**
-        * Download package.
-        * 
-        * @param packageToDownload
-        * @param fileDownloadTargetPath
-        * @param monitor
-        * @return <code>true</code> if success
-        */
-       public boolean downloadPackage(Package packageToDownload,
-                       String fileDownloadTargetPath, IIMProgressMonitor monitor) {
-               Log.log("Download package '" + packageToDownload + "'");
-
-               if (packageToDownload == null || fileDownloadTargetPath == null
-                               || fileDownloadTargetPath.isEmpty()) {
-                       Log.err("InstallManager.downloadPackage(): Invalid package: "
-                                       + packageToDownload + ": This might be a bug of IM");
-                       throw new IMFatalException(
-                                       ErrorCode.PACKAGE_NOT_EXIST_TO_INSTALL_OR_UNINSTALL);
-               }
-
-               // Check cache foler
-               if (existInCacheFolder(packageToDownload, fileDownloadTargetPath)) {
-                       if (monitor != null) {
-                               if (monitor.isCanceled()) {
-                                       throw new IMFatalException(ErrorCode.CANCEL);
-                               } else {
-                                       monitor.workedChecksum(packageToDownload.getPackageSize());
-                               }
-                       }
-                       Log.log("Found in cache");
-
-                       return true;
-               }
-
-               // TODO : refactoring.
-               long size = 0;
-               if (Options.onlyDownload) {
-                       System.out.print("Downloading package => " + packageToDownload  + " .......");
-               }
-               Log.log("start download package: " + packageToDownload);
-               URL packageUrl = packageToDownload.getURL();
-               size = mDownloader.download(packageUrl, fileDownloadTargetPath,
-                               monitor);
-               if (size >= 0) {
-                       if (Options.onlyDownload) {
-                               System.out.println(" done.");
-                       }
-                       Log.log("finish download");
-               } else {                        
-                       Log.err("download failed => " + packageToDownload.getURL());
-                       
-                       String errMsg = "";
-                       if (monitor.isCanceled()) {
-                               errMsg = ErrorController.getErrorMessage();
-                       } else {
-                               errMsg = "Fail to get '" + 
-                                               packageToDownload.getPackageName() + "'."  +
-                                               "\n(" + ErrorController.getErrorMessage() + ")";
-                       }
-                       throw new IMFatalException(errMsg);
-               }
-
-               if (Options.doPackageValidation) {
-                       Log.log("Validate package");
-                       if (!checkPackageSize(packageToDownload, size)) {
-                               Log.err("Package size error. downloaded size => " + size);
-                               throw new IMFatalException(ErrorCode.PACKAGE_WRONG_SIZE);
-                       }
-
-                       // TODO :
-                       if (!checkFileChecksum(packageToDownload,
-                                       mDownloader.getFileChecksum())) {
-                               Log.err("Package checksum error downloaded checksum => "
-                                               + mDownloader.getFileChecksum());
-                               throw new IMFatalException(ErrorCode.PACKAGE_WRONG_CHECKSUM);
-                       }
-               }
-
-               return true;
-       }
-
-       /**
-        * @param pkg
-        * @param filePath
-        * @return <code>true</code> if the package is already downloaded to the
-        *         file path
-        */
-       private boolean existInCacheFolder(Package pkg, String filePath) {
-               File file = new File(filePath);
-
-               if (!file.exists()) {
-                       return false;
-               }
-
-               if (Options.doPackageValidation) {
-                       return checkFileChecksum(pkg, Checksum.getSHA256(filePath));
-               } else {
-                       return true;
-               }
-       }
-
-       private boolean checkPackageSize(Package pkg, long size) {
-               if (pkg.getPackageSize() == size) {
-                       return true;
-               }
-               return false;
-       }
-
-       private boolean checkFileChecksum(Package pkg, MessageDigest mDigest) {
-
-               if (pkg.getSHA256() == null || pkg.getSHA256().isEmpty()) {
-                       return false;
-               }
-
-               if (mDigest.getAlgorithm().equals(Checksum.SHA_256_TYPE)) {
-                       return (pkg.getSHA256().equalsIgnoreCase(Checksum
-                                       .messageDigestToString(mDigest)));
-               } else {
-                       // TODO there's no checksum field in package.
-                       return false;
-               }
-       }
-
-       /**
-        * Package installation management
-        * 
-        * @param pkg
-        *            package to install.
-        * @param targetDir
-        *            target directory to install.
-        * @param monitor
-        * @return
-        */
-       public boolean install(Package pkg, String targetDir,
-                       IIMProgressMonitor monitor) {
-               Log.log("Install package '" + pkg + "'");
-
-               if (monitor != null) {
-                       monitor.setPackageName(pkg.getPackageName());
-               }
-
-               Installer installer = new Installer();
-               boolean bResult = installer.install(pkg, targetDir, monitor);
-
-               if (bResult) {
-                       // save installed package list
-                       packageManager.addPackageToInstalledPackages(pkg);
-                       packageManager.saveInstalledList(PathUtil.get(
-                                       PathUtil.getFromInstalledPath(Config.INFO_DIRECTORY),
-                                       Config.INSTALLED_PACKAGE_LIST_FILE_NAME));
-               } else {
-                       Log.err("InstallManager.install() install fail => " + pkg);
-                       return false;
-               }
-               return bResult;
-       }
-
-       /**
-        * Packages Installation management
-        * 
-        * @param packagesToInstall
-        * @param targetDir
-        * @param monitor
-        * @return
-        * @throws IMExitException
-        */
-       public boolean install(PackageSet metasToInstall, String targetDir,
-                       InstallProgressMonitor monitor) throws IMExitException {
-
-               Log.log("InstallManager.install meta packages " + metasToInstall);
-
-               if (metasToInstall == null || targetDir == null) {
-                       Log.err("packaegs => " + metasToInstall + ", targetDir => "
-                                       + targetDir);
-                       return false;
-               }
-
-               PackageSet pkgsToInstall = null;
-               if (!Options.onlyDownload) {
-
-                       // save target directory
-                       initializeTargetDir(targetDir);
-
-                       // remove missing packages
-                       removeMissingPackages(monitor);
-
-                       // remove conflict packages
-                       if (!removeConflictPackages(metasToInstall, monitor)) {
-                               Log.err("Cannot remove conflict package");
-                               throw new IMFatalException(
-                                               ErrorCode.CONFIG_CANNOT_REMOVE_CONFLICT_PACKAGES);
-                       }
-
-                       boolean result = false;
-                       if (Options.snapshot) {
-                               result = removeDifferentVersionPackages(metasToInstall, monitor);
-                       } else {
-                               result = removeUpdatablePackages(metasToInstall, monitor);
-                       }
-                       
-                       if (!result) {
-                               Log.err("Cannot remove updatable package");
-                               throw new IMFatalException(
-                                               ErrorCode.CONFIG_CANNOT_REMOVE_UPDATABLE_PACKAGES);
-                       }
-
-                       // get All installable packages
-                       pkgsToInstall = packageManager.getInstallablePackages(metasToInstall);
-                       Log.log("Install packages: " + pkgsToInstall);
-               } else {
-                       pkgsToInstall = packageManager.getDependsPackagesFromRepository(metasToInstall);
-               }
-
-               // download packages from repository
-               if (downloadPackages(pkgsToInstall, monitor)) {
-                       Log.log("Success to download packages from repository");
-               } else {
-                       if (Options.doRemovePackages) {
-                               removePackagesDir();
-                       }
-
-                       Log.err("Fail to download packages from repository");
-                       return false;
-               }
-
-               // wait if cancel confirm dialog is showing. wait until user press
-               // button(cancel or not).
-               if (monitor != null) {
-                       while (monitor.checkCancelAndDisableCancelButton() == false) {
-                               if (monitor.isCanceled()) {
-                                       throw new IMInstallCancelException();
-                               }
-                       }
-               }
-
-               if (monitor != null) {
-                       monitor.beginTask("Installing", pkgsToInstall.size() + 1);
-               }
-
-               // make start menu
-               installInstallManager();
-
-               int i = 0;
-               for (Package pkg : pkgsToInstall) {
-                       if (monitor != null) {
-                               monitor.worked(++i);
-                       }
-
-                       if (!install(pkg, targetDir, monitor)) {
-                               Log.log("Installation fail => " + pkg);
-                               throw new IMFatalException(ErrorCode.INSTALLATION_FAIL);
-                       }
-               }
-
-               // remove temp directory
-               String tempDir = targetDir + File.separator + Config.TEMP_DIRECTORY;
-               PathUtil.remove(tempDir);
-
-               // save config file
-               mConfig.saveConfig();
-               
-               // save sdk version.
-               saveSDKVersion();
-
-               // Delete installed packages
-               if (Options.doRemovePackages) {
-                       removePackagesDir();
-               }
-
-               // move InstallManager to target directory
-               if (monitor != null) {
-                       monitor.setFileName("Move to target directory...");
-                       monitor.workedFileName();
-               }
-               
-               return true;
-       }
-       
-       private void removeMissingPackages(IIMProgressMonitor monitor) {
-               PackageSet missingPackages = packageManager
-                               .getMissingPackagesFromRepository();
-               Log.log("Remove missing packages => " + missingPackages);
-
-               if (monitor != null) {
-                       monitor.setPackageName("Remove Missing Packages");
-               }
-
-               for (Package pkg : missingPackages) {
-                       if (!removePackage(pkg, monitor)) {
-                               Log.err("Cannot remove missing package");
-                               throw new IMFatalException(
-                                               ErrorCode.CANNOT_REMOVE_MISSING_PACKAGE);
-                       }
-               }
-       }
-
-       private boolean removeConflictPackages(PackageSet installableMetaPkgs,
-                       IIMProgressMonitor monitor) {
-               PackageSet conflictPackages = packageManager
-                               .getConflictPackagesInUpdate(installableMetaPkgs);
-               Log.log("Remove conflict packages => " + conflictPackages);
-
-               if (monitor != null) {
-                       monitor.setPackageName("Remove Conflict Packages");
-               }
-
-               return remove(conflictPackages);
-       }
-
-       private boolean removeDifferentVersionPackages(PackageSet metasToInstall, 
-                       IIMProgressMonitor monitor) {
-               PackageSet updatablePackages = packageManager
-                               .getdifferentVersionFromInstalledPackages(metasToInstall);
-
-               Log.log("Remove packages in snapshot => " + updatablePackages);
-
-               if (monitor != null) {
-                       monitor.setPackageName("Remove updatable Packages");
-               }
-
-               return remove(updatablePackages);
-       }
-       private boolean removeUpdatablePackages(PackageSet metasToInstall,
-                       IIMProgressMonitor monitor) {
-               PackageSet updatablePackages = packageManager
-                               .getUpdatablepackagesInUpdate(metasToInstall);
-
-               Log.log("Remove updatable packages => " + updatablePackages);
-
-               if (monitor != null) {
-                       monitor.setPackageName("Remove updatable Packages");
-               }
-
-               return remove(updatablePackages);
-       }
-
-       private boolean remove(PackageSet packages) {
-               for (Package pkg : packages) {
-
-                       if (removePackage(pkg, null)) {
-                               continue;
-                       } else {
-                               Log.err("Cannot remove package => " + pkg);
-                               return false;
-                       }
-               }
-
-               return true;
-       }
-
-       /**
-        * Initializes target directory
-        * 
-        * @param targetDir
-        *            path to SDK target directory
-        */
-       public void initializeTargetDir(String targetDir) {
-               Log.log("Initialize target dir. " + targetDir);
-               // Make target directory
-               File targetDirFile = new File(targetDir);
-               if (!targetDirFile.exists()) {
-                       targetDirFile.mkdirs();
-               }
-
-               // Keep target path in system
-               Registry.exportInstallPath(targetDir);
-
-               // Keep target path for later use
-               mConfig.setTargetDir(targetDir);
-
-               // Make .info directory
-               if (!mConfig.makeInfoDirectory()) {
-                       Log.err(Config.CONFIG_HOME + " cannot create.");
-                       throw new IMFatalException(ErrorCode.CANNOT_CREATE_CONFIG_FILE);
-               }
-       }
-       
-       /**
-        * Save installed SDK version.
-        */
-       public void saveSDKVersion() {
-               Registry.saveInstallVersion(mConfig.getConfigFile().getInstallManagerVersion());
-       }
-
-       /**
-        * Make tizen menu and installmanager shortcut.
-        */
-       private void installInstallManager() {
-               Log.log("InstallManager.installInstallManager()");
-
-               // copy InstallManager to target directory
-               copyInstallManagerToTargetDirectory();
-
-               // make icon
-               StartMenu.createDesktopIcon();
-               StartMenu.createInstallManagerIcon();
-
-               // execute install script.
-               File installScript = getInstallScript();
-               if (installScript != null) {
-                       installScript.setExecutable(true);
-
-                       Installer installer = new Installer();
-                       try {
-                               installer.executeScript(installScript);
-                       } catch (IMShellCommandFail e) {
-
-                       }
-               } else {
-                       // when test works, install script does not need.
-               }
-       }
-
-       /**
-        * Get install script from resource according to each platform.
-        * 
-        * @return
-        */
-       private File getInstallScript() {
-               try {
-                       if (Platform.CURRENT_PLATFORM == Platform.LINUX_32
-                                       || Platform.CURRENT_PLATFORM == Platform.LINUX_64) {
-                               return PathUtil.getTempFileFromResource(
-                                               LINUX_INSTALL_MANAGER_INSTALL_SCRIPT, "install", ".sh");
-                       } else if (Platform.CURRENT_PLATFORM == Platform.WINDOWS_32
-                                       || Platform.CURRENT_PLATFORM == Platform.WINDOWS_64) {
-                               return PathUtil.getTempFileFromResource(
-                                               WINDOWS_INSTALL_MANAGER_INSTALL_SCRIPT, "install",
-                                               ".vbs");
-                       } else if (Platform.CURRENT_PLATFORM == Platform.MACOS_64) {
-                               return null;
-                       } else {
-                               throw new IMFatalException(ErrorCode.UNSUPPORTED_PLATFORM);
-                       }
-               } catch (IOException e) {
-                       Log.err("Cannot execute InstallManager's install script.");
-                       Log.ExceptionLog(e);
-                       throw new IMFatalException(ErrorCode.CANNOT_CREATE_SHORTCUT);
-               }
-       }
-
-       private void removeInstallManager() {
-               Log.log("InstallManager.removeInstallManager");
-
-               // execute remove script
-               executeInstallManagerRemoveScript();
-
-               if (Registry.getInstalledPath().isEmpty()) {
-                       return;
-               }
-               // remove InstallManager's file
-               PathUtil.remove(PathUtil.getFromInstalledPath(
-                               Config.INSTALL_MANAGER_DIRECTORY,
-                               Config.INSTALL_MANAGER_UPDATER_BINARY));
-               PathUtil.remove(PathUtil.getFromInstalledPath(
-                               Config.INSTALL_MANAGER_DIRECTORY,
-                               Config.EXECUTE_FILE_NAME_OF_INSTALL_MANAGER));
-               PathUtil.remove(PathUtil.getFromInstalledPath(
-                               Config.INSTALL_MANAGER_DIRECTORY,
-                               Config.EXECUTE_FILE_NAME_OF_INSTALL_MANAGER_PARTNER));
-               PathUtil.remove(PathUtil
-                               .getFromInstalledPath(Config.INSTALL_MANAGER_DIRECTORY,
-                                               Config.INSTALL_MANAGER_BINARY));
-
-               // remove config file
-               PathUtil.remove(PathUtil.getFromInstalledPath(
-                               Config.INSTALL_MANAGER_DIRECTORY,
-                               Config.INSTALL_MANAGER_DEFAULT_CONFIG_FILE_NAME));
-
-               // remove InstallManager Directory
-               PathUtil.remove(PathUtil.getFromInstalledPath(Config.INSTALL_MANAGER_DIRECTORY));
-       }
-
-       private void executeInstallManagerRemoveScript() {
-               File removeScript = getRemoveScript();
-
-               if (removeScript == null) {
-                       return;
-               }
-
-               removeScript.setExecutable(true);
-
-               Installer installer = new Installer();
-               try {
-                       installer.executeScript(removeScript);
-               } catch (IMShellCommandFail e) {
-                       Log.err("Cannot execute InstallManager's remove script.");
-                       Log.ExceptionLog(e);
-               }
-       }
-
-       private File getRemoveScript() {
-               try {
-                       if (Platform.CURRENT_PLATFORM == Platform.LINUX_32
-                                       || Platform.CURRENT_PLATFORM == Platform.LINUX_64) {
-                               return PathUtil.getTempFileFromResource(
-                                               LINUX_INSTALL_MANAGER_REMOVE_SCRIPT, "remove", ".sh");
-                       } else if (Platform.CURRENT_PLATFORM == Platform.WINDOWS_32
-                                       || Platform.CURRENT_PLATFORM == Platform.WINDOWS_64) {
-                               return PathUtil
-                                               .getTempFileFromResource(
-                                                               WINDOWS_INSTALL_MANAGER_REMOVE_SCRIPT,
-                                                               "remove", ".vbs");
-                       } else if (Platform.CURRENT_PLATFORM == Platform.MACOS_64) {
-                               return null;
-                       } else {
-                               throw new IMFatalException(ErrorCode.UNSUPPORTED_PLATFORM);
-                       }
-               } catch (IOException e) {
-                       // TODO Auto-generated catch block
-                       Log.err("Cannot get InstallManager's remove script.");
-                       Log.ExceptionLog(e);
-                       return null;
-               }
-       }
-
-       private void copyInstallManagerToTargetDirectory() {
-               Log.log("Copy InstallManager to target");
-
-               File fromFile = new File(System.getProperty("user.dir"));
-               String from = fromFile.getAbsolutePath();
-
-               if (Registry.getInstalledPath() == null
-                               || Registry.getInstalledPath().equals("")) {
-                       Log.err("Cannot find target dir");
-                       return;
-               }
-
-               File targetDir = new File(Registry.getInstalledPath() + File.separator
-                               + Config.INSTALL_MANAGER_DIRECTORY);
-               if (!targetDir.exists()) {
-                       targetDir.mkdirs();
-               }
-
-               String to = targetDir.getAbsolutePath();
-
-               if (from.equals(to)) {
-                       return;
-               }
-
-               copyInstallManagerFiles(from, to);
-       }
-
-       private void copyInstallManagerFiles(String from, String to) {
-               Log.log("Copy InstallManager files from " + from + " to " + to);
-               //copy execute file.
-               try {
-                       //copy execute file.
-                       PathUtil.copy(
-                                       PathUtil.get(from,Config.EXECUTE_FILE_NAME_OF_INSTALL_MANAGER),
-                                       PathUtil.get(to,        Config.EXECUTE_FILE_NAME_OF_INSTALL_MANAGER));
-                       
-                       //copy execute file for Parter SDK.
-                       PathUtil.copy(
-                                       PathUtil.get(from,Config.EXECUTE_FILE_NAME_OF_INSTALL_MANAGER_PARTNER),
-                                       PathUtil.get(to,        Config.EXECUTE_FILE_NAME_OF_INSTALL_MANAGER_PARTNER));
-                       
-                       //set executable authority.
-                       new File(to + File.separator
-                                       + Config.EXECUTE_FILE_NAME_OF_INSTALL_MANAGER)
-                                       .setExecutable(true);
-                       
-                       //set executable authority.
-                       new File(to + File.separator
-                                       + Config.EXECUTE_FILE_NAME_OF_INSTALL_MANAGER_PARTNER)
-                                       .setExecutable(true);
-                       
-                       //copy InstallManager.jar
-                       PathUtil.copy(
-                                       PathUtil.get(from, "InstallManager.jar"),
-                                       PathUtil.get(to, "InstallManager.jar"));
-                       
-                       //copy InstallManagerUpdater.jar
-                       PathUtil.copy(
-                                       PathUtil.get(from, "InstallManagerUpdater.jar"),
-                                       PathUtil.get(to, "InstallManagerUpdater.jar"));
-                       
-                       //copy installmanager.conf
-                       PathUtil.copy(
-                                       PathUtil.get(from, Config.INSTALL_MANAGER_DEFAULT_CONFIG_FILE_NAME),
-                                       PathUtil.get(to, Config.INSTALL_MANAGER_DEFAULT_CONFIG_FILE_NAME));
-               } catch (IOException e) {
-                       Log.err("Failed to copy Install Manager files");
-               }
-       }
-
-       private void removePackagesDir() {
-               PathUtil.remove(Config.PACKAGE_BINARY_LOCAL_DIRECTORY_PATH);
-       }
-
-       /**
-        * Package uninstallation management
-        * 
-        * @param pkg
-        * @param monitor
-        * @return
-        */
-       public boolean removePackage(Package pkg, IIMProgressMonitor monitor) {
-               Log.log("InstallManager package remove start  => " + pkg);
-
-               if (pkg == null) {
-                       return false;
-               }
-
-               if (monitor != null) {
-                       monitor.setPackageName(pkg.getPackageName());
-               }
-
-               Installer installer = new Installer();
-
-               boolean bResult = installer.uninstall(pkg, monitor);
-
-               // Remove packages in installed package list without result.
-               // We don't know that failed packages are working well.
-               packageManager.exceptPackageFromInstalledPackages(pkg);
-               packageManager.saveInstalledList(PathUtil.get(
-                               PathUtil.getFromInstalledPath(Config.INFO_DIRECTORY),
-                               Config.INSTALLED_PACKAGE_LIST_FILE_NAME));
-
-               Log.log(pkg + " remove end => " + bResult);
-               return bResult;
-       }
-
-       /**
-        * Packages uninstallation management
-        * 
-        * @param pkg
-        * @param monitor
-        * @return
-        */
-       public boolean removePackages(PackageSet metasToRemove,
-                       IIMProgressMonitor monitor) {
-               Log.log("InstallManager Packages remove Start => " + metasToRemove);
-
-               if (metasToRemove == null) {
-                       return false;
-               }
-
-               PackageSet pkgsToRemove = packageManager
-                               .getToRemovePackagesInRemove(metasToRemove);
-               Log.log("Remove packages: " + pkgsToRemove);
-
-               if (monitor != null) {
-                       monitor.beginTask("Uninstalling...", pkgsToRemove.size() + 1);
-               }
-
-               int i = 0;
-               for (Package pkg : pkgsToRemove) {
-                       if (monitor != null) {
-                               monitor.worked(++i);
-                       }
-
-                       if (removePackage(pkg, monitor)) {
-                               continue;
-                       } else {
-                               Log.log("Remove fail but make progress=> " + pkg);
-                       }
-               }
-
-               // if you remove all packages, delete targetDirectory and config File.
-               if (!packageManager.existInstalledMetaPackages()) {
-                       Log.log("Installed meta packages do not exist");
-                       if (monitor != null) {
-                               monitor.setFileName("Remove target directory...");
-                               monitor.worked(pkgsToRemove.size());
-                       }
-
-                       if (packageManager.existInstalledPackages()) {
-                               Log.log("Installed meta packages do not exist, but some packages exist.");
-                               removeAll(monitor);
-                       } else {
-                               // not exist to remove
-                               removeSDK();
-                       }
-               } else {
-               }// Donothing.
-
-               Log.log("InstallManager packages remove success. return => " + true);
-               return true;
-       }
-
-       /**
-        * Remove all of packages.
-        * 
-        * @param monitor
-        */
-       public void removeAll(IIMProgressMonitor monitor) {
-               Log.log("InstallManager.removeAll()");
-
-               PackageSet removablePackages = packageManager.getInstalledPackages();
-
-               for (Package pkg : removablePackages) {
-                       if (!removePackage(pkg, monitor)) {
-                               Log.err("InstallManager.removeAll remove fail => " + pkg);
-                       }
-               }
-
-               removeSDK();
-       }
-
-       /**
-        * Remove All of TizenSDK files.
-        */
-       public void removeSDK() {
-               Log.log("InstallManager removeSDK start");
-
-               removeInstallManager();
-               removeChangeLog();
-               removeInfoDirectory();
-               checkTargetDirAndRemove();
-               Registry.removeRegistry();
-
-               // do not remove config home because it has log files
-               Log.log("InstallManager removeSDK end");
-       }
-
-       private void checkTargetDirAndRemove() {
-               File targetDir = new File(Registry.getInstalledPath());
-               if (canRemoveTargetDir(targetDir)) {
-                       removeTargetDirectory();
-               } else {
-                       Log.err("Cannot delete target directory => "
-                                       + targetDir.getAbsolutePath());
-               }
-       }
-
-       /**
-        * Check status that target directory can remove or not.
-        * 
-        * @param targetDir
-        * @return
-        */
-       private boolean canRemoveTargetDir(File targetDir) {
-               if (targetDir.exists()) {
-                       File[] fileList = targetDir.listFiles();
-                       if ((fileList == null || fileList.length <= 0)
-                                       || (fileList.length == 1 && fileList[0].getName().equals(
-                                                       Config.OLD_INSTALL_MANAGER_DIRECTORY))) {
-                               return true;
-                       } else {
-                               ArrayList<String> fileNames = new ArrayList<String>();
-                               for (File file : fileList) {
-                                       fileNames.add(file.getName());
-                               }
-                               Log.err("The SDK directory is not empty => " + fileNames);
-                               return false;
-                       }
-               } else {
-                       Log.err("The SDK direcotry is already removed");
-                       return false;
-               }
-       }
-
-       private void removeChangeLog() {
-               File releaseNoteFile = new File(
-                               PathUtil.getFromInstalledPath(Config.RELEASE_NOTE));
-
-               if (releaseNoteFile.exists()) {
-                       PathUtil.remove(releaseNoteFile);
-               }
-       }
-
-       private void removeInfoDirectory() {
-               // remove info directory in $HOME/tizen-sdk-data
-               File infoDirFile = new File(
-                               PathUtil.getFromInstalledPath(Config.INFO_DIRECTORY));
-               if (infoDirFile.exists()) {
-                       PathUtil.remove(infoDirFile);
-               }
-
-               // remove info directory in target directory
-               File targetInfoFile = new File(
-                               PathUtil.getFromInstalledPath(Config.INFO_DIRECTORY));
-
-               if (targetInfoFile.exists()) {
-                       PathUtil.remove(targetInfoFile);
-               }
-       }
-
-       /**
-        * Remove target directory.
-        */
-       public void removeTargetDirectory() {
-               Log.log("InstallManager remove target directory start");
-
-               if (Platform.CURRENT_PLATFORM == Platform.LINUX_32
-                               || Platform.CURRENT_PLATFORM == Platform.LINUX_64
-                               || Platform.CURRENT_PLATFORM == Platform.MACOS_64) {
-                       PathUtil.remove(Registry.getInstalledPath());
-               } else if (Platform.CURRENT_PLATFORM == Platform.WINDOWS_32
-                               || Platform.CURRENT_PLATFORM == Platform.WINDOWS_64) {
-                       if (!WindowsProgramController.removeRunningDir(Registry
-                                       .getInstalledPath())) {
-                               Log.err("Cannot remove target directory");
-                       }
-               } else {
-                       throw new IMFatalException(ErrorCode.UNSUPPORTED_PLATFORM);
-               }
-
-               Log.log("InstallManager remove target directory end");
-       }
-
-       /**
-        * Singleton and global downloader shared and used by every components in IM
-        * 
-        * @return singleton downloader object
-        */
-       public static Downloader getDownloader() {
-               return InstallManager.mDownloader;
-       }
-}
diff --git a/SdkImageCreator/src/org/tizen/installmanager/core/Installer.java b/SdkImageCreator/src/org/tizen/installmanager/core/Installer.java
deleted file mode 100644 (file)
index 63782b7..0000000
+++ /dev/null
@@ -1,492 +0,0 @@
-/*
- *  InstallManager
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: 
- * Wooyoung Cho <wooyoung1.cho@samsung.com>
- * Shihyun Kim <shihyun.kim@samsung.com>
- * Taeyoung Son <taeyoung2.son@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.BufferedReader;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Stack;
-
-import org.tizen.installmanager.lib.ErrorController;
-import org.tizen.installmanager.lib.IIMProgressMonitor;
-import org.tizen.installmanager.lib.Log;
-import org.tizen.installmanager.lib.LoggerShellParser;
-import org.tizen.installmanager.lib.Platform;
-import org.tizen.installmanager.lib.Registry;
-import org.tizen.installmanager.lib.SDKPackageFormat;
-import org.tizen.installmanager.lib.ErrorController.ErrorCode;
-import org.tizen.installmanager.pkg.model.Package;
-import org.tizen.installmanager.util.IMShellCommandFail;
-import org.tizen.installmanager.util.PathUtil;
-import org.tizen.installmanager.util.ShellUtil;
-
-/**
- * This class manages lowlevel install/uninstall operations
- * 
- * @author Shihyun Kim <shihyun.kim@samsung.com>
- */
-public class Installer {
-       /**
-        * Install a package to target directory.
-        * 
-        * @param pack
-        *            Package to be installed.
-        * @param targetDir
-        *            Target directory to install.
-        * @param monitor
-        *            If you want to express in UI, implement IIMProgressMonitor and
-        *            set this parametor. if not, set <code>null</code>.
-        * @return <code>true</code>, if installation is success.
-        */
-       public boolean install(Package pack, String targetDir,
-                       IIMProgressMonitor monitor) {
-               Log.log("**** installer install start => " + pack + ", target => "
-                               + targetDir);
-
-               // unzip in temp dir
-               String tempDir = PathUtil.get(targetDir, Config.TEMP_DIRECTORY);
-
-               long unZipSize = unZipPackage(pack, tempDir, monitor);
-
-               if (unZipSize <= 0) {
-                       Log.err("Unzip failed. => " + pack);
-                       PathUtil.remove(tempDir);
-                       throw new IMFatalException(ErrorCode.CANNOT_UNPACK_PACKAGE);
-               }
-               if (!checkUnzipSize(pack, unZipSize)) {
-                       Log.err("Unzip size error. => " + pack);
-                       PathUtil.remove(tempDir);
-                       throw new IMFatalException(ErrorCode.CANNOT_UNPACK_PACKAGE);
-               }
-
-               if (!moveToTargetDirectoryFromTempDirectory(tempDir, targetDir)) {
-                       PathUtil.remove(tempDir);
-                       Log.err("Moving temp to target failed. Remove temp and cancel installing.");
-                       throw new IMFatalException(
-                                       ErrorCode.CANNOT_MOVE_FILE_TO_TARGET_DIRECTORY);
-               }
-
-               List<File> missingFiles = findMissingFiles(pack);
-               if (missingFiles.size() > 0) {
-                       Log.err("Some files are not moved properly: " + missingFiles);
-               }
-
-               executeInstallScript(pack, monitor, tempDir);
-
-               // move removeScript file to special Directory
-               File removeScriptFrom = new File(tempDir + File.separator
-                               + pack.getRemoveScript());
-
-               if ((pack.getRemoveScript() != null)
-                               && !(pack.getRemoveScript().equals(""))
-                               && (removeScriptFrom.exists())) {
-                       File removeScriptTo = new File(getRemoveScriptLocalPath(pack));
-                       if (!createRemoveScriptDir(removeScriptTo)) {
-                               Log.err("Cannot create remove script directory in Info directory => "
-                                               + pack.getPackageName());
-                               return false;
-                       } else {
-                               if (removeScriptTo.exists()) {
-                                       removeScriptTo.delete();
-                               }
-                               if (!PathUtil.moveFile(removeScriptFrom, removeScriptTo)) {
-                                       Log.err("Cannot move removeScript to targetDir => "
-                                                       + pack.getPackageName());
-                                       return false;
-                               }
-                       }
-               }
-               PathUtil.remove(tempDir);
-               return true;
-       }
-
-       /**
-        * @param pack
-        * @return list of files which are not moved normally
-        */
-       private List<File> findMissingFiles(Package pack) {
-               LinkedList<File> missingFiles = new LinkedList<File>();
-               File listFile = new File(getInstalledFileListPath(pack));
-               InputStream is = null;
-               BufferedReader in = null;
-               try {
-                       is = new FileInputStream(listFile);
-                       in = new BufferedReader(new InputStreamReader(is, "UTF-8"));
-                       String line;
-                       while ((line = in.readLine()) != null) {
-                               File tmp = new File(PathUtil.getFromInstalledPath(line));
-                               if (!tmp.exists()) {
-                                       if (Platform.CURRENT_PLATFORM == Platform.WINDOWS_32) {
-                                               missingFiles.add(tmp);
-                                       } else if (Platform.CURRENT_PLATFORM == Platform.LINUX_32 
-                                                       || Platform.CURRENT_PLATFORM == Platform.LINUX_64
-                                                       || Platform.CURRENT_PLATFORM == Platform.MACOS_64) {
-                                               // check if it is broken link
-                                               try {
-                                                       int exitCode = ShellUtil.execute("ls " + tmp, null);
-                                                       if (exitCode == 0) {
-                                                               Log.log("broken link " + tmp
-                                                                               + " but no problem");
-                                                       } else {
-                                                               Log.err(tmp + " not exist.");
-                                                               missingFiles.add(tmp);
-                                                       }
-                                               } catch (IMShellCommandFail e) {
-                                                       Log.err("Failed to check file exists");
-                                                       Log.ExceptionLog(e);
-                                               }
-                                       } else {
-                                               throw new IMFatalException(
-                                                               ErrorCode.UNSUPPORTED_PLATFORM);
-                                       }
-                               }
-                       }
-               } catch (IOException e) {
-                       Log.err("Installer.findMissingFiles() Cannot check file list: "
-                                       + listFile.getAbsolutePath());
-                       throw new IMFatalException(
-                                       ErrorCode.CANNOT_CHECK_INSTLLED_FILE_LIST);
-               } finally {
-                       if (in != null) {
-                               try {
-                                       in.close();
-                               } catch (IOException e) {
-                                       Log.ExceptionLog(e);
-                               }
-                       }
-                       
-                       if (is != null) {
-                               try {
-                                       is.close();
-                               } catch (IOException e) {
-                                       Log.ExceptionLog(e);
-                               }
-                       }
-               }
-               return missingFiles;
-       }
-
-       /**
-        * Set script running process' environment variables.
-        * 
-        * @return Environment variables map
-        */
-       private Map<String, String> setEnvironmentVariable() {
-               HashMap<String, String> env = new HashMap<String, String>();
-
-               env.put("INSTALLED_PATH", Registry.getInstalledPath());
-               env.put("MAKESHORTCUT_PATH", InstallManager.getInstance()
-                               .getMakeShortCutPath());
-               env.put("REMOVE_SHORTCUT", InstallManager.getInstance()
-                               .getRemoveShortCutPath());
-               env.put("USER_DATA_PATH", Config.getConfigHome());
-               
-               if (Options.partnerSdk) {
-                       env.put("PARTNER_SDK", "partner");
-               } else {
-                       env.put("PARTNER_SDK", "");
-               }
-
-               return env;
-       }
-
-       private long unZipPackage(Package pkg, String tempDir,
-                       IIMProgressMonitor monitor) {
-               String filePath = PathUtil.getFromCurrDir(pkg.getFileName());
-
-               File pkgFile = new File(filePath);
-               if (!pkgFile.exists()) {
-                       Log.err(filePath + " doesn't exist");
-                       throw new IMFatalException(ErrorCode.CANNOT_FIND_FILE_IN_LOCAL);
-               }
-
-               SDKPackageFormat format = SDKPackageFormat.createSDKPackageFormat();
-
-               // Each packages are saved installed list to file
-               String installedFileListPath = getInstalledFileListPath(pkg);
-
-               format.setFileOutput(installedFileListPath);
-
-               return format.unZip(filePath, tempDir, monitor);
-       }
-
-       private String getRemoveScriptLocalPath(Package pkg) {
-               return PathUtil.get(
-                               PathUtil.getFromInstalledPath(Config.INFO_DIRECTORY),
-                               pkg.getPackageName(), pkg.getRemoveScript());
-       }
-
-       private String getInstalledFileListPath(Package pkg) {
-               return PathUtil.get(
-                               PathUtil.getFromInstalledPath(Config.INFO_DIRECTORY),
-                               pkg.getPackageName(), (pkg.getPackageName() + ".list"));
-       }
-
-       private boolean moveToTargetDirectoryFromTempDirectory(String tempDir,
-                       String targetDir) {
-               Log.log("Move temp to target");
-               File fromFile = new File(tempDir + File.separator
-                               + Config.DATA_DIRECTORY);
-               if (!fromFile.exists()) {
-                       Log.err("Data directory is not exist in package.");
-                       return true;
-               }
-               File toFile = new File(targetDir);
-
-               File[] fromList = fromFile.listFiles();
-
-               if (fromList == null) {
-                       return false;
-               }
-
-               for (int i = 0; i < fromList.length; i++) {
-                       boolean ret = false;
-                       if (Platform.CURRENT_PLATFORM == Platform.LINUX_32
-                                       || Platform.CURRENT_PLATFORM == Platform.LINUX_64) {
-                               ret = PathUtil.copyHardLink(fromList[i], toFile);
-                       } else if (Platform.CURRENT_PLATFORM == Platform.WINDOWS_32
-                                       || Platform.CURRENT_PLATFORM == Platform.WINDOWS_64) {
-                               ret = PathUtil.move(fromList[i],
-                                               new File(toFile, fromList[i].getName()));
-                       } else if (Platform.CURRENT_PLATFORM == Platform.MACOS_64) {
-                               ret = PathUtil.copyHardLink(fromList[i], toFile);
-                       } else {
-                               throw new IMFatalException(ErrorCode.UNSUPPORTED_PLATFORM);
-                       }
-                       if (!ret) {
-                               return false;
-                       }
-               }
-               return true;
-       }
-
-       /**
-        * Uninstalls the given package
-        * 
-        * @param pkg
-        *            package to be uninstalled
-        * @param monitor
-        * @return true if success. false if fatal error. delete failure is checked
-        *         and sets error status in ErrorController but still returns true.
-        *         if file to be deleted doesn't exist, it's not considered error.
-        */
-       public boolean uninstall(Package pkg, IIMProgressMonitor monitor) {
-               Log.log("Installer uninstall start");
-               int resultRemoveScript = executeRemoveScript(pkg, monitor);
-
-               if (resultRemoveScript == 0) {
-                       Log.log("Execute remove script success.");
-               } else if (resultRemoveScript == 1) {
-                       Log.err("Execute remove script fail.");
-               } else if (resultRemoveScript == 2) {
-                       Log.log("This package does not need a remove script.");
-               }
-
-               File installedFileList = new File(getInstalledFileListPath(pkg));
-
-               if (!installedFileList.exists()) {
-                       ErrorController.setError(ErrorCode.CANNOT_FIND_INSTALLED_FILE_LIST);
-                       return false;
-               }
-
-               BufferedReader reader = null;
-               try {
-                       reader = new BufferedReader(new FileReader(installedFileList));
-
-                       String line = null;
-                       Stack<File> dirStack = new Stack<File>();
-                       while ((line = reader.readLine()) != null) {
-                               File deleteFile = new File(PathUtil.getFromInstalledPath(line));
-
-                               if (deleteFile.isDirectory()) {
-                                       File[] listFiles = deleteFile.listFiles();
-
-                                       if (listFiles == null || listFiles.length <= 0) {
-                                               deleteIfExists(deleteFile);
-                                       } else {
-                                               dirStack.push(deleteFile);
-                                       }
-                               } else {
-                                       deleteIfExists(deleteFile);
-                               }
-                       }
-
-                       while (!dirStack.isEmpty()) {
-                               File deleteDir = dirStack.pop();
-                               File[] listFiles = deleteDir.listFiles();
-
-                               if (listFiles == null || listFiles.length <= 0) {
-                                       deleteIfExists(deleteDir);
-                               }
-                       }
-
-               } catch (FileNotFoundException e) {
-                       Log.err("File not found => " + installedFileList.getAbsolutePath());
-                       return false;
-               } catch (IOException e) {
-                       Log.err("IO Exception => " + installedFileList.getAbsolutePath());
-                       return false;
-               } catch (Throwable e) {
-                       Log.ExceptionLog(e);
-                       return false;
-               } finally {
-                       try {
-                               if (reader != null) {
-                                       reader.close();
-                                       deleteIfExists(installedFileList);
-                               }
-                       } catch (IOException ioe) {
-                               Log.err("Close fileoutput fail.");
-                       }
-               }
-
-               return true;
-       }
-
-       /**
-        * Delete the <code>file</code>
-        * 
-        * @param file
-        */
-       private void deleteIfExists(File file) {
-               if (!file.delete()) {
-                       Log.err("Delete fail -> " + file.getAbsolutePath());
-               }
-       }
-
-       private boolean checkUnzipSize(Package pack, long size) {
-               // TODO : impl. not supported
-               return true;
-       }
-
-       private boolean createRemoveScriptDir(File removeScript) {
-               File parentDir = removeScript.getParentFile();
-
-               if (!parentDir.exists()) {
-                       return parentDir.mkdirs();
-               } else {
-                       return true;
-               }
-       }
-
-       private boolean executeInstallScript(Package pack,
-                       IIMProgressMonitor monitor, String tempDir) {
-               if (pack.getInstallScript() != null
-                               && !pack.getInstallScript().equals("")) {
-                       String command = PathUtil.get(tempDir, pack.getInstallScript());
-                       File scriptFile = new File(command);
-
-                       if (scriptFile.exists()) {
-                               Log.log("Execute install script");
-
-                               if (monitor != null) {
-                                       monitor.setFileName(scriptFile.getName());
-                                       monitor.workedFileName();
-                               }
-                               try {
-                                       return executeScript(scriptFile);
-                               } catch (IMShellCommandFail e) {
-                                       Log.ExceptionLog(e);
-                                       throw new IMFatalException(
-                                                       ErrorCode.INSTALL_SCRIPT_FATAL_ERROR);
-                               }
-                       } else {
-                               Log.log(pack.getPackageName() + " does not have install script");
-                       }
-               }
-               return true;
-       }
-
-       private int executeRemoveScript(Package pkg, IIMProgressMonitor monitor) {
-               Log.log("executeRemoveScript => " + pkg.getRemoveScript());
-
-               // execute remove script
-               String script = PathUtil.get(getRemoveScriptLocalPath(pkg));
-               File scriptFile = new File(script);
-
-               if (scriptFile.exists()) {
-
-                       if (monitor != null) {
-                               monitor.setFileName(scriptFile.getName());
-                               monitor.workedFileName();
-                       }
-
-                       try {
-                               if (executeScript(scriptFile)) {
-                                       return 0; // succeed to execute remove script.
-                               } else {
-                                       return 1; // fail to execute remove script.
-                               }
-                       } catch (IMShellCommandFail e) {
-                               Log.ExceptionLog(e);
-                               throw new IMFatalException(ErrorCode.REMOVE_SCRIPT_FATAL_ERROR);
-                       }
-               }
-               return 2; // package does not need remove script.
-       }
-
-       /**
-        * Executes the file with default environment variables
-        * 
-        * @param scriptFile
-        * @return <code>true</code> if success
-        * @throws IMShellCommandFail
-        */
-       public boolean executeScript(File scriptFile) throws IMShellCommandFail {
-               scriptFile.setExecutable(true);
-               Map<String, String> env = setEnvironmentVariable();
-
-               String command = ShellUtil.addInterpreter(scriptFile.getAbsolutePath());
-
-               int exitCode = ShellUtil.execute(command, env, null,
-                               new LoggerShellParser());
-
-               // check exit code
-               if (exitCode == 0) {
-                       return true;
-               } else if (exitCode > 0 && exitCode < 10) {
-                       Log.err("Exit code => " + Integer.toString(exitCode));
-                       return false;
-               } else {
-                       Log.err("Installer.executeScript() install script error => "
-                                       + scriptFile.getAbsolutePath());
-                       Log.err("Exit code => " + Integer.toString(exitCode));
-                       throw new IMFatalException(ErrorCode.INSTALL_SCRIPT_FATAL_ERROR);
-               }
-       }
-}
diff --git a/SdkImageCreator/src/org/tizen/installmanager/core/Options.java b/SdkImageCreator/src/org/tizen/installmanager/core/Options.java
deleted file mode 100644 (file)
index 9e1407b..0000000
+++ /dev/null
@@ -1,248 +0,0 @@
-/*
-*  InstallManager
-*
-* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
-*
-* Contact: 
-* Wooyoung Cho <wooyoung1.cho@samsung.com>
-* Shihyun Kim <shihyun.kim@samsung.com>
-* Taeyoung Son <taeyoung2.son@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.File;
-import java.util.Arrays;
-import java.util.Iterator;
-
-import org.tizen.installmanager.lib.Log;
-import org.tizen.installmanager.lib.ErrorController.ErrorCode;
-
-
-/**
- * This class represents options from command line arguments.
- * @author Wooyoung Cho <wooyoung1.cho@samsung.com>
- *
- */
-public class Options {
-       /**
-        * Do sanity checks including file size and checksum 
-        */
-       public static boolean doPackageValidation = true;
-       /**
-     * Do auto install without GUI
-     */
-       public static boolean doAutoInstall = true;
-       
-       /**
-        * Do download package file.
-        */
-       public static boolean onlyDownload = false;
-       
-       /**
-        * Do remove temporary installmanager that exist in /tmp/tizensdk
-        */
-       public static boolean doRemoveTempTizenSDK = true;
-       
-       /**
-        * Conf file provided by user
-        */
-       public static String userConfPath = null;
-       
-       /**
-        * update installmanager.
-        * If <code>doUpdateInstallManager</code> is false, do not update installmanager binary.
-        */
-       public static boolean doUpdateInstallManager = true;
-       /**
-        * Do replace repository. 
-        * If <code>doRepository</code> is true, change repository address to <code>repo</code> variable.  
-        */
-       public static boolean doReplaceRepository = false;
-       
-       /**
-        * Do remove packages after installation
-        */
-       public static boolean doRemovePackages = true;
-       
-       /**
-        * Do remove old sdk.
-        * If installer cannot update sdk, <code>doRemoveOldSDK</code> is true.
-        */
-       public static boolean doRemoveOldSDK = false;
-       /**
-        * Just check installer is available for update.
-        */
-       public static boolean checkPackageUpdate = false;
-       
-       /**
-        * Prints dependency graph of packages
-        */
-       public static boolean printDepGraph = false;
-       
-       /**
-        * Use Snapshot file.
-        */
-       public static boolean snapshot = false;
-       
-       public static String repo = null;
-       public static String snapshotPath = null;
-       
-       /**
-        * Use only download for making SDK image.
-        */
-       public static String boundary = null; // all, public, partner
-       public static String platForm = null;
-       public static int platFormBit = 0;
-       
-       /**
-        * See all snapshots
-        */
-       public static boolean allSnapshots = false;
-       
-       /**
-        * Support Partner SDK
-        */
-       public static boolean partnerSdk = false;
-       public static String purposeOfInstalling = "public";
-       
-       /**
-        * Display InstallManager Version
-        */
-       public static boolean showVersion = false;
-       
-       /**
-        * User-provided proxy server
-        */
-       public static String proxy = null;
-       
-       public static String[] args;
-       
-       /**
-        * Parses command line arguments and sets corresponding options. 
-        * @param args command line arguments
-        */
-       public static void loadCmdArgs(String[] args) {
-               Options.args = args;
-               Iterator<String> iter = Arrays.asList(args).iterator();
-               try {
-                       while(iter.hasNext()) {
-                               String arg = iter.next();
-                               Log.log(arg+" option is specified");
-       
-                               if(arg.equals("-noPackageValidation")) {
-                                       doPackageValidation = false;
-                               } else if(arg.equals("-doAutoInstall")) {
-                                       doAutoInstall = true;
-                               } else if(arg.equals("-conf")) {
-                                       if(iter.hasNext()) {
-                                               userConfPath = iter.next();
-                                               Log.log("User conf path: "+userConfPath);
-                                               File userConf = new File(userConfPath);
-                                               if (!userConf.exists()) {
-                                                       Log.err("There is no user config file in this path : " + userConfPath);
-                                                       throw new IMFatalException(ErrorCode.CANNOT_FIND_USER_CONFIG_FILE);
-                                               } else {
-                                                       Log.log("Found user config file in this path : " + userConfPath);
-                                               }
-                                       } else {
-                                               Log.err("-conf requires absolute path to the user conf file");
-                                               throw new IMFatalException(ErrorCode.CANNOT_FIND_USER_CONFIG_FILE);
-                                       }
-                               } else if(arg.equals("-noRemovePackages")) {
-                                       doRemovePackages = false;
-                               } else if(arg.equals("-skipUpdate")) {
-                                       doUpdateInstallManager = false;
-                               } else if(arg.equals("-checkPackageUpdate")) {
-                                       checkPackageUpdate = true;
-                               } else if(arg.equals("-printDepGraph")) {
-                                       printDepGraph = true;
-                               } else if(arg.equals("-proxy")) {
-                                       if(iter.hasNext()) {
-                                               proxy = iter.next();
-                                               Log.log("User-provided proxy: "+proxy);
-                                       } else {
-                                               Log.err("-proxy requires proxy description");
-                                               throw new IMFatalException(ErrorCode.PROXY_NOT_PROVIDED);
-                                       }
-                               } else if (arg.equals("-snapShot")) {
-                                       if(iter.hasNext()) {
-                                               snapshot = true;
-                                               snapshotPath = iter.next();
-                                               Log.log("User-provided repository: " + repo);
-                                       } else {
-                                               Log.err("-snapShot requires repository description");
-                                               throw new IMFatalException(ErrorCode.USESNAPSHOT_REPOSITORY_NOT_PROVIDED);
-                                       }
-                               } else if (arg.equals("-allSnapshots")) {
-                                       allSnapshots = true;
-                                       Log.log("Using '-allSnapshots' option, all snapshots are displaying.");
-                               } else if (arg.equals("-onlyDownload")) {
-                                       if(iter.hasNext()) {
-                                               onlyDownload = true;
-                                               boundary = iter.next();
-                                               platForm = iter.next().toLowerCase();
-                                               platFormBit = Integer.parseInt(iter.next());
-                                               Log.log("Only download boundary : "+ boundary);
-                                       } else {
-                                               Log.err("-onlyDownload requires packageList description");
-                                               throw new IMFatalException(ErrorCode.REPOSITORY_NOT_PROVIDED);
-                                       }
-                                       onlyDownload = true;
-                               } else if (arg.equals("-version")) {
-                                       showVersion = true;
-                                       Log.log("Using '-version' option, display InstallManager version on console.");
-                               } else if (arg.equals("-noRemoveTempTizenSDK")) {
-                                       doRemoveTempTizenSDK = false;
-                               } else if (arg.equals("-repository")) {
-                                       if(iter.hasNext()) {
-                                               doReplaceRepository = true;
-                                               repo = iter.next();
-                                               Log.log("replace repository : "+repo);
-                                       } else {
-                                               Log.err("-replaceRepository requires repository description");
-                                               throw new IMFatalException(ErrorCode.REPOSITORY_NOT_PROVIDED);
-                                       }
-                               } else if (arg.equals("-removeOldSDK")) {
-                                       doRemoveOldSDK = true;
-                               } else {
-                                       Log.err("InstallManager do not support '" + arg + "' option");
-                                       throw new IMFatalException(ErrorCode.WRONG_OPTION);
-                               }
-                       }
-               } catch(Throwable e) {
-                       Log.err("Check your options. => " + Arrays.toString(args));
-                       System.err.println("Check your options. => " + Arrays.toString(args));
-                       System.exit(1);
-               }
-       }
-
-       /**
-        * Get options.
-        * @return
-        */
-       public static String getArgsStr() {
-               String argsStr = "";
-               for(String arg : args) {
-                       argsStr = argsStr + " " + arg;
-               }
-               return argsStr;
-       }
-}
diff --git a/SdkImageCreator/src/org/tizen/installmanager/core/SDKExtensionInfo.java b/SdkImageCreator/src/org/tizen/installmanager/core/SDKExtensionInfo.java
deleted file mode 100644 (file)
index b3f5054..0000000
+++ /dev/null
@@ -1,169 +0,0 @@
-/*
-*  InstallManager
-*
-* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
-*
-* Contact: 
-* 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.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.LinkedHashMap;
-
-import org.tizen.installmanager.lib.Log;
-import org.tizen.installmanager.pkg.lib.PackageManager;
-import org.tizen.installmanager.pkg.model.ConfigFile;
-import org.tizen.installmanager.pkg.model.PackageSet;
-
-/**
- * This class can manages extension information
- * 
- * @author Shihyun Kim <shihyun.kim@samsung.com>
- *
- */
-public class SDKExtensionInfo {
-       
-       private static SDKExtensionInfo sdkExtensionInfo = null;
-       //member variable
-       LinkedHashMap<String, String> userExtensionRepositories = new LinkedHashMap<String, String>();
-       LinkedHashMap<String, String> builtInExtensionRepositories = new LinkedHashMap<String, String>();
-       
-       //member func
-       private SDKExtensionInfo() {
-               load();
-       }
-       
-       public boolean add(String name, String packageRepo) {
-               if (name == null || !checkPackageRepo(packageRepo)) {
-                       return false;
-                       
-               } else {                        
-                       if (contains(packageRepo)) {
-                               return false;
-                       }
-                       userExtensionRepositories.put(packageRepo, name);
-                       return true;
-               }
-       }
-       
-       public boolean contains(String packageRepo) {
-               return userExtensionRepositories.containsKey(packageRepo);
-       }
-       
-       public boolean containsBuiltIn(String packageRepo) {
-               return builtInExtensionRepositories.containsKey(packageRepo);
-       }
-       
-       public void remove(String packageRepo) {
-               if (contains(packageRepo)) {
-                       userExtensionRepositories.remove(packageRepo);
-               }
-       }
-       
-       public void save() {
-               ConfigFile confFile = Config.getInstance().getConfigFile();
-               
-               confFile.setExtensionServer(userExtensionRepositories.toString());
-               
-               Config.getInstance().saveConfig();
-       }
-       
-       public void load() {
-               String extensionInfo = Config.getInstance().getConfigFile().getExtensionServer();
-               String builtInExtensionInfo = Config.getInstance().getConfigFile().getBuiltInExtensionServer();
-               
-               builtInExtensionRepositories = parseLocationInformationToMap(builtInExtensionInfo);
-               userExtensionRepositories = parseLocationInformationToMap(extensionInfo);
-       }
-       
-       public boolean checkPackageRepo(String packageRepo) {
-               try {
-                       new URL(packageRepo);
-                       return true;
-               } catch (MalformedURLException e) {
-                       Log.err("Extension package server is not URL format.(" + packageRepo +")");
-                       return false;
-               }
-       }
-       
-       private LinkedHashMap<String, String> parseLocationInformationToMap(String info) {
-               LinkedHashMap<String, String> extensionInformation = new LinkedHashMap<String, String>();
-               if (info.startsWith("{")) {
-                       info = info.substring(1);
-               }
-               
-               if (info.endsWith("}")) {
-                       info = info.substring(0, info.length() -1);
-               }
-               
-               String[] properties = info.split(",");
-               
-               for(String property : properties) {
-                       String[] nameValue = property.split("=");
-                       
-                       if (nameValue.length == 2) {
-                               extensionInformation.put(nameValue[0], nameValue[1]);
-                       }
-               }
-               return extensionInformation;
-       }
-       
-       public PackageSet getExtensionPackages() {
-               PackageManager pm = PackageManager.getInstance();
-               
-               if (pm == null) {
-                       return PackageSet.EMPTY;
-               } else {
-                       try {
-                               //Get all extension repositories.
-                               LinkedHashMap<String, String> extensionRepositories = new LinkedHashMap<String, String>();
-                               extensionRepositories.putAll(builtInExtensionRepositories);
-                               extensionRepositories.putAll(userExtensionRepositories);
-                               
-                               pm.loadExtensionPackages(extensionRepositories.keySet());
-                               return pm.getRootMetaPackagesOfExtensionServer();
-                               
-                       } catch (IOException e) {
-                               Log.ExceptionLog(e);
-                               return PackageSet.EMPTY;
-                       }
-               }
-       }
-       
-       public LinkedHashMap<String, String> getExtensionRepositories() {
-               return userExtensionRepositories;
-       }
-       
-       public LinkedHashMap<String, String> getBuiltInExtensionRepositories() {
-               return builtInExtensionRepositories;
-       }
-       
-       public static SDKExtensionInfo getInstance() {
-               if (sdkExtensionInfo == null) {
-                       sdkExtensionInfo = new SDKExtensionInfo();
-               }
-               
-               return sdkExtensionInfo;
-       }
-}
diff --git a/SdkImageCreator/src/org/tizen/installmanager/core/SnapshotLog.java b/SdkImageCreator/src/org/tizen/installmanager/core/SnapshotLog.java
deleted file mode 100644 (file)
index f57b587..0000000
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- *  InstallManager
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: 
- * Wooyoung Cho <wooyoung1.cho@samsung.com>
- * Shihyun Kim <shihyun.kim@samsung.com>
- * Taeyoung Son <taeyoung2.son@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.File;
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import org.tizen.installmanager.lib.Downloader;
-import org.tizen.installmanager.lib.Log;
-import org.tizen.installmanager.util.PathUtil;
-
-/**
- * This class loads snapshot's change log.
- * 
- * @author Yongsung Kim <yongsung1.kim@samsung.com>
- */
-public class SnapshotLog {
-       String snapshotLog;
-       String SNAPSHOT_LOG_FILE_SUFFIX = ".log";
-       String SNAPSHOT_LOG_FILE_DIRECTORY = "changes"; // snapshot change log directory at repository.
-       
-       String repository = null;
-       
-       public SnapshotLog(String repo) {
-               repository = repo;
-       }
-       
-       public String getSnapshotLog(String snapshot) {
-               String snapshotLogFileName = snapshot + SNAPSHOT_LOG_FILE_SUFFIX;
-               
-               if(downloadSnapshotLog(snapshotLogFileName)) {
-                       Log.log("Success to load " +  snapshotLogFileName);
-                       return snapshotLog;
-               } else {
-                       Log.err("Fail to load " +  snapshotLogFileName + "(Ignore it)");
-                       return null;
-               }
-       }
-       
-       private boolean downloadSnapshotLog(String snapshotLogFileName) {
-               File tmp = null;
-               try {
-                       tmp = File.createTempFile("snapshotLog", ".log");
-                       tmp.deleteOnExit();
-               } catch (IOException e) {
-                       Log.ExceptionLog(e);
-                       return false;
-               }
-                                                                                                                            
-               //download snapshotLog.log file from repository
-               Downloader downloader = new Downloader();
-               
-               URL distInfoFileURL = getSnapshotLogFilePath(repository, snapshotLogFileName);
-
-               long size = downloader.download(distInfoFileURL, tmp.getAbsolutePath(), null);
-               if (size < 0) {
-                       return false;
-               }
-
-               String snapshotLogText = PathUtil.readAllTextFromFile(tmp.getAbsolutePath());
-
-               if (snapshotLogText.isEmpty()) {
-                       snapshotLog = "Thers is no log information about " + snapshotLogFileName;
-                       Log.log("Thers is no log information about " + snapshotLogFileName);
-               } else {
-                       snapshotLog = snapshotLogText;
-               }
-
-               // temp file cleanup
-               if (tmp.exists()) {
-                       tmp.delete();
-               }
-               
-               return true;
-       }
-       
-       private URL getSnapshotLogFilePath(String repo, String snapshotName) {
-               String snapshotLogFilePath = PathUtil.addURLPath(repo, SNAPSHOT_LOG_FILE_DIRECTORY, snapshotName);
-               
-               try {
-                       return new URL(snapshotLogFilePath);
-               } catch (MalformedURLException e) {
-                       Log.err("Cannot connect snapshot log file in repository(" + snapshotLogFilePath + ")");
-                       return null;
-               }
-       }
-}
diff --git a/SdkImageCreator/src/org/tizen/installmanager/core/UpdateInstallManager.java b/SdkImageCreator/src/org/tizen/installmanager/core/UpdateInstallManager.java
deleted file mode 100644 (file)
index 5accfe3..0000000
+++ /dev/null
@@ -1,335 +0,0 @@
-/*
- *  InstallManager
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: 
- * Wooyoung Cho <wooyoung1.cho@samsung.com>
- * Shihyun Kim <shihyun.kim@samsung.com>
- * Taeyoung Son <taeyoung2.son@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.File;
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import org.tizen.installmanager.lib.Downloader;
-import org.tizen.installmanager.lib.Log;
-import org.tizen.installmanager.pkg.model.ConfigFile;
-import org.tizen.installmanager.pkg.model.Version;
-import org.tizen.installmanager.util.PathUtil;
-import org.tizen.installmanager.util.ShellUtil;
-
-/**
- * This class checks the update of Install Manager itself, download it, and
- * invokes updater process to replace the current binary.
- * 
- * @author Wooyoung Cho <wooyoung1.cho@samsung.com>
- * 
- */
-public class UpdateInstallManager {
-
-       private ConfigFile mCurrentConfig = null;
-       private ConfigFile mRepositoryConfig = null;
-
-       private Downloader mDownloader = null;
-
-       public UpdateInstallManager() {
-               this.mDownloader = InstallManager.getDownloader();
-       }
-
-       private boolean setCurrentConfig() {
-               InstallManager.getInstance().initConfig();
-               mCurrentConfig = InstallManager.getInstance().getConfig()
-                               .getConfigFile();
-
-               if (mCurrentConfig != null) {
-                       return true;
-               } else {
-                       return false;
-               }
-       }
-
-       /**
-        * Download configuration file from repository and set to instance.
-        * 
-        * @return true if success
-        */
-       public boolean setRepositoryConfig() {
-               String repository = mCurrentConfig.getInstallManagerRepository();
-               if (repository.isEmpty()) {
-                       return false;
-               } else {
-                       String repositoryConfigPath = repository + "/"
-                                       + Config.INSTALL_MANAGER_DEFAULT_CONFIG_FILE_NAME;
-
-                       URL repositoryConfigUrl;
-                       try {
-                               repositoryConfigUrl = new URL(repositoryConfigPath);
-                       } catch (MalformedURLException e) {
-                               Log.log("Invalid repository");
-                               return false;
-                       }
-                       String downloadedConfigPath = downloadConfigFileFromRepository(repositoryConfigUrl);
-                       if (downloadedConfigPath != null) {
-                               mRepositoryConfig = new ConfigFile(downloadedConfigPath);
-                               return true;
-                       } else {
-                               return false;
-                       }
-               }
-       }
-
-       /**
-        * @param repositoryConfigUrl
-        * @return path to the conf file downloaded to local from the url. null if
-        *         failed
-        */
-       private String downloadConfigFileFromRepository(URL repositoryConfigUrl) {
-               Log.log("Download conf file from repo: " + repositoryConfigUrl);
-
-               File tmpFile;
-               try {
-                       tmpFile = File.createTempFile("installmanager.repository", ".conf");
-                       tmpFile.deleteOnExit();
-               } catch (IOException e) {
-                       Log.log("Cannot create temp file for conf file of repository");
-                       return null;
-               }
-
-               String configToLocal = tmpFile.getAbsolutePath();
-
-               long size = mDownloader.download(repositoryConfigUrl,
-                               configToLocal, null);
-
-               if (size >= 0) {
-                       return configToLocal;
-               } else {
-                       Log.log("Download failed.");
-                       return null;
-               }
-       }
-
-       private boolean downloadInstallManager() {
-               String downloadInstallManagerPath = PathUtil.getFromCurrDir(
-                               Config.TEMP_DIRECTORY, Config.INSTALL_MANAGER_BINARY);
-               Log.log("Download install manager: " + downloadInstallManagerPath);
-
-               File downloadInstallManagerFile = new File(downloadInstallManagerPath);
-               if (downloadInstallManagerFile.exists()) {
-                       downloadInstallManagerFile.delete();
-               } else {
-               }
-
-               File parentDir = downloadInstallManagerFile.getParentFile();
-               if (!parentDir.exists()) {
-                       parentDir.mkdirs();
-               } else {
-               }
-
-               URL serverIntallManager = null;
-               try {
-                       serverIntallManager = new URL(
-                                       mCurrentConfig.getInstallManagerRepository() + "/"
-                                                       + Config.INSTALL_MANAGER_BINARY);
-               } catch (MalformedURLException e) {
-                       Log.log("Invalid install manager repository url");
-                       return false;
-               }
-               if (mDownloader.download(serverIntallManager,
-                               downloadInstallManagerPath, null) <= 0) {
-                       Log.err("Failed to download install manager binary");
-                       return false;
-               } else {
-                       Log.log("install manager binary download success");
-                       return true;
-               }
-       }
-
-       private boolean downloadUpdater() {
-               String path = PathUtil
-                               .getFromCurrDir(Config.INSTALL_MANAGER_UPDATER_BINARY);
-               Log.log("Download install manager updater to: " + path);
-
-               File file = new File(path);
-               if (file.exists()) {
-                       file.delete();
-               } else {
-               }
-
-               File parentDir = file.getParentFile();
-               if (!parentDir.exists()) {
-                       parentDir.mkdirs();
-               } else {
-               }
-
-               URL url = null;
-               try {
-                       url = new URL(mCurrentConfig.getInstallManagerRepository() + "/"
-                                       + Config.INSTALL_MANAGER_UPDATER_BINARY);
-               } catch (MalformedURLException e) {
-                       Log.log("Invalid install manager repository url");
-                       return false;
-               }
-               if (mDownloader.download(url, path, null) <= 0) {
-                       Log.err("Failed to download install manager binary");
-                       return false;
-               } else {
-                       Log.log("install manager updater binary download success");
-                       return true;
-               }
-       }
-
-       private void updateInstallManager(String newInstallManager,
-                       String oldInstallManager){
-               String updaterPath = PathUtil
-                               .getFromCurrDir(Config.INSTALL_MANAGER_UPDATER_BINARY);
-
-               String command = "java -jar " + updaterPath + " " + newInstallManager
-                               + " " + oldInstallManager;
-
-               if (!Options.getArgsStr().isEmpty()) {
-                       command = command + " " + Options.getArgsStr();
-               }
-
-               Process proc = ShellUtil.asyncExecute(command);
-
-               if (proc != null) {
-                       Log.err("Exit for update");
-               } else {
-                       Log.err("Running updater failed");
-               }
-       }
-
-       /**
-        * Reads current config file and new config file.
-        * 
-        * @return <code>true</code> if success
-        */
-       private boolean init() {
-               boolean result = setCurrentConfig();
-               if (!result) {
-                       // if current config file does not exist, it's fatal error
-                       Log.err("UpdateInstallManager.init() Cannot read config file");
-                       throw new IMFatalException("Cannot read config file");
-               } else {
-                       Log.log("Sucess to read current config file.");
-               }
-
-               result = setRepositoryConfig();
-               if (!result) {
-                       Log.log("Cannot read config file from Install Manager repository. Ignore it.");
-                       return false;
-               }
-
-               if (mRepositoryConfig.getRepository() != null
-                               && !mRepositoryConfig.getRepository().isEmpty()) {
-                       mCurrentConfig.setRepository(mRepositoryConfig.getRepository());
-               }
-
-               if (mCurrentConfig.getDistribution().isEmpty()) {
-                       mCurrentConfig.setDistribution(mRepositoryConfig.getDistribution());
-               }
-
-               mCurrentConfig.saveConfig(mCurrentConfig.getConfigPath());
-               return true;
-       }
-
-       /**
-        * check and try to update install manager itself
-        * 
-        * @throws IMExitException
-        *             thrown if there's new version of IM
-        */
-       public boolean update(){
-               Log.log("check install manager update");
-               if (!init()) {
-                       Log.log("Cannot read repository config file");
-                       return false;
-               }
-
-               if (isUpdatable()) {
-                       Log.log("Install Manager is updatable");
-
-                       boolean bResult;
-                       bResult = updateUpdater();
-                       if (bResult == false) {
-                               Log.err("Updating Install Manager Updater failed");
-                               return false;
-                       }
-
-                       bResult = downloadInstallManager();
-
-                       if (bResult == true) {
-                               // update config file
-                               mCurrentConfig.setInstallManagerVersion(mRepositoryConfig
-                                               .getInstallManagerVersion());
-                               mCurrentConfig.saveConfig(mCurrentConfig.getConfigPath());
-
-                               String newInstallManager = PathUtil.getFromCurrDir(
-                                               Config.TEMP_DIRECTORY, Config.INSTALL_MANAGER_BINARY);
-                               String oldInstallManager = PathUtil
-                                               .getFromCurrDir(Config.INSTALL_MANAGER_BINARY);
-
-                               updateInstallManager(newInstallManager, oldInstallManager);
-                               return true;
-                       } else {
-                               return false;
-                       }
-               } else {
-                       Log.log("no install manager update");
-                       return false;
-               }
-       }
-
-       private boolean updateUpdater() {
-               boolean result = downloadUpdater();
-               if (!result) {
-                       Log.err("Downloading Install Manager Updater failed");
-                       return false;
-               } else {
-                       Log.log("Downloading Install Manager Updater success");
-                       return true;
-               }
-       }
-
-       private boolean isUpdatable() {
-               if (mCurrentConfig == null || mRepositoryConfig == null) {
-                       return false;
-               } else {
-                       String currentVersion = mCurrentConfig.getInstallManagerVersion();
-                       String repositoryVersion = mRepositoryConfig
-                                       .getInstallManagerVersion();
-
-                       if (currentVersion.equals("") || repositoryVersion.equals("")) {
-                               return false;
-                       } else {
-                               if (Version.compareVersion(repositoryVersion, currentVersion) > 0) {
-                                       return true;
-                               } else {
-                                       return false;
-                               }
-                       }
-               }
-       }
-}
diff --git a/SdkImageCreator/src/org/tizen/installmanager/lib/Checksum.java b/SdkImageCreator/src/org/tizen/installmanager/lib/Checksum.java
deleted file mode 100644 (file)
index 63d28ca..0000000
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
-*  InstallManager
-*
-* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
-*
-* Contact: 
-* Wooyoung Cho <wooyoung1.cho@samsung.com>
-* Shihyun Kim <shihyun.kim@samsung.com>
-* Taeyoung Son <taeyoung2.son@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.lib;
-
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.security.MessageDigest;
-import java.security.NoSuchAlgorithmException;
-
-/**
- * Manage Checksum digest
- * @author Shihyun Kim<shihyun.kim@samsung.com>
- *
- */
-public class Checksum {
-       public static final String SHA_256_TYPE = "SHA-256";
-       
-       private static final int BUF_SIZE = 65536;
-       
-       /**
-        * Make SHA256 digest from filePath.
-        * @param filePath
-        * @return MessageDigest instance from filePath.
-        */
-       public static MessageDigest getSHA256(String filePath) {
-               MessageDigest mDigest = null;
-               try {
-                       mDigest = MessageDigest.getInstance(SHA_256_TYPE);
-               } catch (NoSuchAlgorithmException e) {
-                       Log.err("No such algorithem => " + filePath);
-                       return null;
-               }       
-               
-               InputStream is = null;
-        try {
-            is = new FileInputStream(filePath);
-        } catch (FileNotFoundException fnfException) {
-               Log.err("Checksum getSHA256 file not found => " + filePath);
-               return null;
-        }
-        
-        byte[] buf = new byte[BUF_SIZE];
-        int readSize = 0;
-        try {
-                       while ((readSize = is.read(buf)) >= 0) {
-                               mDigest.update(buf, 0, readSize);
-                       }
-               } catch (IOException e) {
-                       Log.err("Checksum getSHA256 IOException");
-                       return null;
-               } finally {
-                   if (is != null) {
-                   try {
-                       is.close();
-                   }
-                   catch (IOException e) {
-                       Log.err("checksum getSHA256 fail to close output stream");
-                   }
-               }
-               }
-               
-               return mDigest; 
-       }
-       
-       /**
-        * Get SHA256 hexdigit code from digest.
-        * @param digest MessageDigest isntance
-        * @return 
-        */
-       public static String messageDigestToString(MessageDigest digest) {
-               byte[] bDigest = digest.digest();
-
-               StringBuffer hexString = new StringBuffer();
-
-        for (int i = 0; i < bDigest.length; i++) {
-            hexString.append(hexDigit(bDigest[i]));
-        }
-
-        return hexString.toString();
-       }
-       
-       private static String hexDigit(byte x) {
-        StringBuffer sb = new StringBuffer();
-        char c;
-
-        // First nibble
-        c = (char) ((x >> 4) & 0xf);
-        if (c > 9) {
-            c = (char) ((c - 10) + 'a');
-        }
-        else {
-            c = (char) (c + '0');
-        }
-        sb.append(c);
-
-        // Second nibble
-        c = (char) (x & 0xf);
-        if (c > 9) {
-            c = (char) ((c - 10) + 'a');
-        }
-        else {
-            c = (char) (c + '0');
-        }
-        sb.append(c);
-        
-        return sb.toString();
-    }
-       
-}
diff --git a/SdkImageCreator/src/org/tizen/installmanager/lib/Documents.java b/SdkImageCreator/src/org/tizen/installmanager/lib/Documents.java
deleted file mode 100644 (file)
index 56a2f6f..0000000
+++ /dev/null
@@ -1,110 +0,0 @@
-/*\r
-*  InstallManager\r
-*\r
-* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.\r
-*\r
-* Contact: \r
-* Wooyoung Cho <wooyoung1.cho@samsung.com>\r
-* Shihyun Kim <shihyun.kim@samsung.com>\r
-* Taeyoung Son <taeyoung2.son@samsung.com>\r
-* Yongsung kim <yongsung1.kim@samsung.com>\r
-* \r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
-* you may not use this file except in compliance with the License.\r
-* You may obtain a copy of the License at\r
-*\r
-* http://www.apache.org/licenses/LICENSE-2.0\r
-*\r
-* Unless required by applicable law or agreed to in writing, software\r
-* distributed under the License is distributed on an "AS IS" BASIS,\r
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-* See the License for the specific language governing permissions and\r
-* limitations under the License.\r
-*\r
-* Contributors:\r
-* - S-Core Co., Ltd\r
-*\r
-*/ \r
-\r
-package org.tizen.installmanager.lib;\r
-\r
-import java.awt.Desktop;\r
-import java.io.File;\r
-import java.io.IOException;\r
-\r
-import org.eclipse.swt.widgets.Button;\r
-import org.tizen.installmanager.core.IMFatalException;\r
-import org.tizen.installmanager.lib.ErrorController.ErrorCode;\r
-import org.tizen.installmanager.ui.InstallManagerWindow;\r
-import org.tizen.installmanager.util.PathUtil;\r
-\r
-/**\r
- * Manages Documents for InstallManager.\r
- * @author Yongsung Kim<yongsung1.kim@samsung.com>\r
- *\r
- */\r
-public class Documents {\r
-       public static final String RELEASE_NOTE_FILENAME = "release-note.html";\r
-       private static String OPEN_SOURCE_LICENSE_NAME = "Tizen_OpenSource_License_Information.pdf";\r
-       private static String OPEN_SOURCE_LICENCE_PATH = PathUtil.get("/res", OPEN_SOURCE_LICENSE_NAME);\r
-       \r
-       private Documents() {} \r
-\r
-       /**\r
-        * Make sure that the check box is checked.\r
-        * @return boolean\r
-        */\r
-       public static boolean isChecked() {\r
-               Button btn = InstallManagerWindow.getInstallManagerWindow().getCompletePage().getChkBtn();\r
-               return btn.getSelection();\r
-       }\r
-       \r
-       /**\r
-        * show the change log(history).\r
-        */\r
-       public static void showChangeLog() {\r
-               String releaseNotePath = PathUtil.getFromInstalledPath(RELEASE_NOTE_FILENAME);\r
-               File releaseNote = new File(releaseNotePath);\r
-               \r
-               if (releaseNote.exists()) {\r
-                       if (Desktop.isDesktopSupported()) {\r
-                               Log.log("Desktop.isDesktopSupported() is true.");\r
-                               try {\r
-                                       Desktop.getDesktop().open(releaseNote);\r
-                                       Log.log("Success to open release note. => " + releaseNotePath);\r
-                               } catch (IOException e) {\r
-                                       Log.err("cannot open release note. => "  + releaseNotePath);\r
-                                       Log.ExceptionLog(e);\r
-                               }\r
-                       } else {\r
-                               Log.err("Desktop.isDesktopSupported() is false.");\r
-                       }\r
-               } else {\r
-                       Log.log("Release note not found. => " + releaseNotePath);\r
-               }\r
-       }\r
-       \r
-       /**\r
-        * Copy the 'Tizen_OpenSource_License_Information.pdf' to target directory.\r
-        */\r
-       public static void copyOpenLicense() {\r
-               File openLicenseFile = new File(PathUtil.getFromInstalledPath(OPEN_SOURCE_LICENSE_NAME));\r
-               try {\r
-                       PathUtil.copyFileFromResource(OPEN_SOURCE_LICENCE_PATH, openLicenseFile);\r
-               } catch (IOException e) {\r
-                       Log.err("Cannot read resource '" + OPEN_SOURCE_LICENCE_PATH + "'");\r
-                       throw new IMFatalException(ErrorCode.CANNOT_CREATE_RESOURCE);\r
-               }\r
-       }\r
-       \r
-       /**\r
-        * Remove the 'Tizen_OpenSource_License_Information.pdf' from target directory.\r
-        */     \r
-       public static void removeOpenLicense() {\r
-               File openLicenseFile = new File(PathUtil.getFromInstalledPath(OPEN_SOURCE_LICENSE_NAME));\r
-               \r
-               if (openLicenseFile.exists()) {\r
-                       PathUtil.remove(openLicenseFile);\r
-               }\r
-       }\r
-}\r
diff --git a/SdkImageCreator/src/org/tizen/installmanager/lib/Downloader.java b/SdkImageCreator/src/org/tizen/installmanager/lib/Downloader.java
deleted file mode 100644 (file)
index a3b6c60..0000000
+++ /dev/null
@@ -1,696 +0,0 @@
-/*
- *  InstallManager
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact:
- * Wooyoung Cho <wooyoung1.cho@samsung.com>
- * Shihyun Kim <shihyun.kim@samsung.com>
- * Taeyoung Son <taeyoung2.son@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.lib;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.ConnectException;
-import java.net.HttpURLConnection;
-import java.net.InetAddress;
-import java.net.InetSocketAddress;
-import java.net.MalformedURLException;
-import java.net.NoRouteToHostException;
-import java.net.Proxy;
-import java.net.SocketAddress;
-import java.net.SocketException;
-import java.net.SocketTimeoutException;
-import java.net.URL;
-import java.net.URLConnection;
-import java.net.UnknownHostException;
-import java.security.MessageDigest;
-import java.security.NoSuchAlgorithmException;
-import java.util.List;
-import java.util.NoSuchElementException;
-
-import javax.net.ssl.SSLHandshakeException;
-
-import org.tizen.installmanager.core.Config;
-import org.tizen.installmanager.core.IMFatalException;
-import org.tizen.installmanager.core.InstallManager;
-import org.tizen.installmanager.core.Options;
-import org.tizen.installmanager.lib.ErrorController.ErrorCode;
-
-
-
-/**
- * Manages downloading from url.
- * 
- * @author Shihyun Kim <shihyun.kim@samsung.com>
- * 
- */
-public class Downloader {
-       private static final String PROTOCOL_SEPARATOR = "://";
-       private static final String USER_PASSWORD_SEPARATOR = ":";
-       private static final String ID_SEPARATOR = "@";
-
-       final int BUF_SIZE = 65536;
-
-       public static final long ERROR = -1;
-
-       private MessageDigest mDigest;
-       private URLConnection mConnection = null;
-       private final int CONNECT_TIMEOUT = 10000; // connection timeout: 10 sec
-       private final int READ_TIMEOUT = 20000; // connection timeout: 20 sec
-       private final int CONNECT_THREAD_JOIN_TIMEOUT = 11000; //// connection thread timeout: 11 sec
-
-       private String mUser = "";
-       private String mPassword = "";
-
-       public Downloader() {
-               try {
-                       mDigest = MessageDigest.getInstance("SHA-256");
-               } catch (NoSuchAlgorithmException e) {
-                       Log.err("Downloader No algorithm for SHA-256");
-                       throw new IMFatalException("No algorithm for SHA-256");
-               }
-       }
-
-       /**
-        * Downloads the url to the local path
-        * 
-        * @param sUrl
-        *            url to download
-        * @param localPath
-        *            local path to save the file from the url
-        * @param monitor
-        * @return download size in bytes if success. -1 if fail.
-        */
-       public long download(URL sUrl, String localPath, IIMProgressMonitor monitor) {
-               Log.log("Downloading: " + sUrl + " -> " + localPath);
-
-               if (localPath == null || localPath.equals("")) {
-                       return ERROR;
-               }
-
-               if ((sUrl == null || sUrl.toExternalForm().equals(""))) {
-                       return ERROR;
-               }
-
-               if (!connect(sUrl) || mConnection == null) {
-                       Log.err("Network connection error.\n" + sUrl);
-                       return ERROR;
-               }
-
-               InputStream input = null;
-               try {
-                       input = mConnection.getInputStream();
-               } catch (FileNotFoundException e) {
-                       Log.ExceptionLog(e);
-                       int index = sUrl.toString().lastIndexOf("/");
-                       String errUrl =sUrl.toString().substring(0, index);
-                       String errorMsg = ErrorCode.CANNOT_FIND_FILE_IN_REPOSITROY.getErrorMessage()
-                   + "\n(URL = " + errUrl + ")";
-                       ErrorController.setErrorMessage(errorMsg);
-                       return ERROR;
-               } catch (SocketTimeoutException e) {
-                       Log.ExceptionLog(e);
-                       ErrorController.setError(ErrorCode.SERVER_CONNECTION_TIME_OUT);
-                       return ERROR;
-               } catch (NoRouteToHostException e) {
-                       Log.ExceptionLog(e);
-                       ErrorController.setError(ErrorCode.NO_ROUTE_TO_HOST);
-                       Log.err(ErrorController.getErrorMessage());
-                       return ERROR;
-               } catch (SocketException e) {
-                       Log.ExceptionLog(e);
-                       ErrorController.setError(ErrorCode.INTERNET_CONNECTION_ERROR);
-                       Log.err(ErrorController.getErrorMessage());
-                       return ERROR;
-               } catch (IOException e) {
-                       Log.ExceptionLog(e);
-                       if (e.getClass().toString().indexOf("FtpLoginException") >= 0) {
-                               ErrorController.setError(ErrorCode.NOT_LOGGED_IN);
-                               Log.err(ErrorController.getErrorMessage());
-                               return ERROR;
-                       }
-                       
-                       ErrorController.setError(ErrorCode.CANNOT_DOWNLOAD_FILE);
-                       Log.err(ErrorController.getErrorMessage());
-                       return ERROR;
-               } catch (Throwable e) {
-                       Log.ExceptionLog(e);
-                       ErrorController.setErrorMessage(e.getMessage());
-                       return ERROR;
-               }
-
-               File destFile = new File(localPath);
-               if (!destFile.isAbsolute()) {
-                       return ERROR;
-               }
-               
-               File parentDir = destFile.getParentFile();
-               if (!parentDir.exists()) {
-                       parentDir.mkdirs();
-               }
-
-               if (destFile.exists()) {
-                       destFile.delete();
-               }
-
-               try {
-                       destFile.createNewFile();
-               } catch (IOException e) {
-                       Log.ExceptionLog(e);
-                       ErrorController.setError(ErrorCode.CANNOT_CREATE_DOWNLOAD_FILE);
-                       return ERROR;
-               }
-
-               FileOutputStream output = null;
-               try {
-                       output = new FileOutputStream(destFile);
-               } catch (FileNotFoundException e) {
-                       Log.ExceptionLog(e);
-                       ErrorController.setError(ErrorCode.CANNOT_CREATE_DOWNLOAD_FILE);
-                       return ERROR;
-               }
-
-               byte[] buf = new byte[BUF_SIZE];
-               long totalWriteSize = 0;
-               long writeSizePerSecond = 0;
-               long totalFileSize = getDownloadFileSize();
-
-               long beginMS = System.currentTimeMillis();
-               try {
-                       if (mDigest != null) {
-                               mDigest.reset();                                
-                       } else {
-                               //TODO : Consider this condition later.
-                       }
-                       Log.log("File download start.");
-                       while (totalWriteSize < totalFileSize) {
-                               if (input.available() > 0) {
-                                       int inputReadSize = input.read(buf);
-
-                                       output.write(buf, 0, inputReadSize);
-
-                                       totalWriteSize += inputReadSize;
-                                       writeSizePerSecond += inputReadSize;
-
-                                       if (mDigest != null) {
-                                               mDigest.update(buf, 0, inputReadSize);
-                                       }
-
-                                       long endMS = System.currentTimeMillis();
-                                       if (endMS > (beginMS + 100)) {
-                                               if (monitor != null) {
-                                                       if (monitor.isCanceled()) {
-                                                               ErrorController.setError(ErrorCode.CANCEL);
-                                                               return ERROR;
-                                                       }
-                                                       monitor.workedDownload(writeSizePerSecond);
-                                               }
-
-                                               writeSizePerSecond = 0;
-                                               beginMS = endMS;
-                                       }
-                               }
-
-                               long endMS = System.currentTimeMillis();
-                               if (endMS > (beginMS + READ_TIMEOUT)) {
-                                       Log.err("Can not be read during 20 seconds.");
-                                       ErrorController
-                                                       .setError(ErrorCode.INTERNET_CONNECTION_ERROR);
-                                       return ERROR;
-                               }
-                       }
-               } catch (SocketTimeoutException e) {
-                       Log.ExceptionLog(e);
-                       ErrorController.setError(ErrorCode.SERVER_CONNECTION_TIME_OUT);
-                       return ERROR;
-               } catch (IOException e) {
-                       Log.ExceptionLog(e);
-                       ErrorController.setError(ErrorCode.ERROR);
-                       return ERROR;
-               } catch (Exception e) {
-                       Log.ExceptionLog(e);
-                       ErrorController.setError(ErrorCode.ERROR);
-                       return ERROR;
-               }
-               finally {
-                       try {
-                               if (input != null) {
-                                       input.close();
-                               }
-                       } catch (IOException e) {
-                               Log.ExceptionLog(e);
-                       }
-                       
-                       try {
-                               if (output != null) {
-                                       output.close();
-                               }
-                       } catch (IOException e) {
-                               Log.ExceptionLog(e);
-                               // ignore
-                       }
-               }
-               Log.log("Downloaded size: " + totalWriteSize);
-               return totalWriteSize;
-       }
-
-       /**
-        * Set user name.
-        * 
-        * @param user
-        */
-       public void setUser(String user) {
-               mUser = user;
-       }
-
-       /**
-        * Set password
-        * 
-        * @param password
-        */
-       public void setPassword(String password) {
-               mPassword = password;
-       }
-
-       /**
-        * Get MessageDigest instance from downloading file.
-        * 
-        * @return
-        */
-       public MessageDigest getFileChecksum() {
-               return mDigest;
-       }
-
-       /**
-        * Connect to aUrl and ready to download.
-        * 
-        * @param aUrl
-        * @return <code>true</code> if connect success.
-        */
-       public boolean connect(URL aUrl) {
-               if (isAvailableURL(aUrl)) {
-                       boolean bRet = false;
-                       URL url = null;
-                       try {
-                               if (!mUser.equals("") || !mPassword.equals("")) {
-                                       String fullUrl = aUrl.getProtocol() + PROTOCOL_SEPARATOR
-                                                       + mUser + USER_PASSWORD_SEPARATOR + mPassword
-                                                       + ID_SEPARATOR + aUrl.getHost() + aUrl.getPath();
-       
-                                       url = new URL(fullUrl);
-                               } else {
-                                       url = aUrl;
-                               }
-       
-                               bRet = connection(url);
-       
-                       } catch (MalformedURLException e) {
-                               Log.ExceptionLog(e);
-                               return false;
-                       } catch (Throwable e) {
-                               Log.ExceptionLog(e);
-                               return false;
-                       }
-       
-                       return bRet;
-               } else {
-                       return false;
-               }
-       }
-
-       private boolean isAvailableURL(URL url) {
-               if (url.getProtocol().equalsIgnoreCase("file")) {
-                       return true;
-               }
-               SocketAddress socketAddress = null;
-               try {
-                       int port = url.getPort();
-                       if (port < 0) {
-                               port = url.getDefaultPort();
-                       }
-                       socketAddress = getSocketAddress(url.getHost(), port);
-
-               } catch (IMFatalException e) {
-                       Log.ExceptionLog(e);
-                       return false;
-               }
-
-               if (socketAddress == null) {
-                       return false;
-               } else {
-                       return true;
-               }
-       }
-
-       private boolean connection(URL url) {
-               Log.log("Connect to " + url);
-
-               boolean bRet = false;
-               if (NetworkProxy.useProxy) {
-                       bRet = connectWithProxy(url);
-                       
-                       if (!bRet) {
-                               bRet = connectWithDirect(url);
-                               
-                               if (bRet) {
-                                       NetworkProxy.useProxy = false;
-                               }
-                       }
-               }  else {
-                       bRet = connectWithDirect(url);
-                       
-                       if (!bRet) {
-                               bRet = connectWithProxy(url);
-                               
-                               if (bRet) {
-                                       NetworkProxy.useProxy = true;
-                               }
-                       }
-               }
-
-               return bRet;
-       }
-       
-       private boolean connectWithProxy(URL url) {
-               String protocol = url.getProtocol();
-               Config conf = InstallManager.getInstance().getConfig();
-       
-               boolean bRet = false;
-               if (protocol.startsWith("file")) {
-                       Log.log("Connect to local path.");
-                       bRet = connectToURL(url, Proxy.NO_PROXY);
-
-               } else if (Options.proxy != null) {
-                       Log.log("Connect to repository with '-proxy' option.");
-                       bRet = connectToURL(url, getOptionalProxy());
-
-               } else if (conf.hasProxy()) {
-                       Log.log("Connect to repository with config proxy.");
-                       bRet = connectToURL(url, getConfigProxy());
-
-               } else { // system proxy
-                       Log.log("Connect to repository with system proxy.");
-                       List<Proxy> proxyList = NetworkProxy.getSystemProxyList(url);
-
-                       for (Proxy proxy : proxyList) {
-                               if (bRet = connectToURL(url, proxy)) {
-                                       break;
-                               }
-                       }
-               }
-               
-               return bRet;
-       }
-       
-       private boolean connectWithDirect(URL url) {            
-               boolean bRet = false;
-               
-               String protocol = url.getProtocol();
-               if (protocol.startsWith("file")) {
-                       Log.log("Connect to local path.");
-                       bRet = connectToURL(url, Proxy.NO_PROXY);
-
-               } else {
-                       Proxy directProxy = NetworkProxy.getHttpDirectProxy(url);
-                       bRet = connectToURL(url, directProxy);
-               }
-               
-               return bRet;
-       }
-
-       private boolean connectToURL(final URL url, final Proxy proxy) {
-
-               ConnectionThread connectionThread = new ConnectionThread(url, proxy);
-                       
-               connectionThread.setDaemon(true);
-               connectionThread.start();
-               
-               try {
-                       connectionThread.join(CONNECT_THREAD_JOIN_TIMEOUT);
-               } catch (InterruptedException e) {
-                       Log.ExceptionLog(e);
-               }
-               
-               if (!connectionThread.getConnectionResult()) {
-                       return false;
-               }
-               
-               if (connectionThread.isAlive()) {
-                       ErrorController.setError(ErrorCode.INTERNET_CONNECTION_ERROR);
-                       Log.err("Cannot connect to server (URL => " + url +"). Connection thread still alive.");
-                       Log.err("proxy => " + proxy);
-                       return false;
-               }
-               
-               if (!checkConnectionStatus(mConnection)) {
-                       return false;
-               }
-
-               if (mConnection.getContentLength() < 0) {
-                       Log.err("Cannot connect to repository(url=>" + url + ", proxy=>" + proxy);
-                       ErrorController.setError(ErrorCode.INTERNET_CONNECTION_ERROR);
-                       return false;
-               } else {
-                       return true;
-               }
-       }
-       
-       private boolean checkConnectionStatus(URLConnection connection) {
-               if (connection == null) {
-                       return false;
-               } else {
-                       String protocol = connection.getURL().getProtocol();
-                       if (protocol.equalsIgnoreCase("http")) {
-                               return checkHttpConnectionStatus(connection);
-                       } else if (protocol.equalsIgnoreCase("ftp")) {
-                               return true;
-                       } else {
-                               return true;
-                       }
-               }
-       }
-       
-       private boolean checkHttpConnectionStatus(URLConnection connection) {
-               HttpURLConnection httpCon = (HttpURLConnection)connection;
-               
-               int responseCode;
-               String responseMessage = "";
-               try {
-                       responseCode = httpCon.getResponseCode();
-                       responseMessage = httpCon.getResponseMessage();
-               } catch (IOException e) {
-                       Log.ExceptionLog(e);
-                       ErrorController.setError(ErrorCode.INTERNET_CONNECTION_ERROR);
-                       return false;
-               }
-               
-               Log.log(Integer.toString(responseCode));
-               Log.log(responseMessage);
-               
-               switch(responseCode) {
-               case HttpURLConnection.HTTP_OK :
-                       return true;
-               case HttpURLConnection.HTTP_NOT_FOUND :
-                       ErrorController.setError(ErrorCode.CANNOT_FIND_FILE_IN_REPOSITROY);
-                       break;
-               case HttpURLConnection.HTTP_UNAUTHORIZED :
-                       ErrorController.setError(ErrorCode.HTTP_ERROR_MESSAGE_401);
-                       break;
-               case HttpURLConnection.HTTP_FORBIDDEN :
-                       ErrorController.setError(ErrorCode.HTTP_ERROR_MESSAGE_403);
-                       break;
-               case -1 :
-                       Log.err("Http response code returns -1(null). It looks a Linux bug.");
-                       ErrorController.setError(ErrorCode.INTERNET_CONNECTION_ERROR);
-                       break;
-               default :
-                       String errMsg = "Server connection failed." + 
-                    "\nError message : " + 
-                    responseMessage +
-                    "(Code number=" + Integer.toString(responseCode) + ")";
-                       ErrorController.setErrorMessage(errMsg);
-                       break;
-               }
-               
-               return false;
-       }
-
-       private Proxy getOptionalProxy() {
-               Config conf = InstallManager.getInstance().getConfig();
-
-               String[] arr = Options.proxy.split(":");
-               try {
-                       Log.log("Use user-provided proxy: " + Options.proxy);
-
-                       SocketAddress addr = getSocketAddress(arr[0], arr[1]);
-
-                       // save proxy server and port
-                       conf.getConfigFile().setProxyServer(arr[0]);
-                       conf.getConfigFile().setProxyPort(arr[1]);
-
-                       return new Proxy(Proxy.Type.HTTP, addr);
-               } catch (IllegalArgumentException e) {
-                       Log.ExceptionLog(e);
-                       throw new IMFatalException(ErrorCode.PROXY_SERVER_IS_WRONG);
-               } catch (ArrayIndexOutOfBoundsException e) {
-                       Log.ExceptionLog(e);
-                       throw new IMFatalException(ErrorCode.PROXY_SERVER_IS_WRONG);
-               } catch (IMFatalException e) {
-                       Log.ExceptionLog(e);
-                       throw new IMFatalException(e.getMessage() + "\n(proxy: " + arr[0]
-                                       + ":" + arr[1] + ").");
-               }
-       }
-
-       private Proxy getConfigProxy() {
-               Config conf = InstallManager.getInstance().getConfig();
-
-               Log.log("Use proxy specified in .conf file: "
-                               + conf.getConfigFile().getProxyServer() + ":"
-                               + conf.getConfigFile().getProxyPort());
-
-               SocketAddress addr = null;
-               try {
-                       addr = getSocketAddress(conf.getConfigFile().getProxyServer(), conf
-                                       .getConfigFile().getProxyPort());
-               } catch (IMFatalException e) {
-                       throw new IMFatalException(e.getMessage() + "\n(proxy:"
-                                       + conf.getConfigFile().getProxyServer() + ":"
-                                       + conf.getConfigFile().getProxyPort() + ").");
-               }
-
-               return new Proxy(Proxy.Type.HTTP, addr);
-       }
-
-       private SocketAddress getSocketAddress(String address, String port)
-                       throws IMFatalException {
-               try {
-                       return getSocketAddress(address, Integer.parseInt(port));
-               } catch (NumberFormatException e) {
-                       Log.ExceptionLog(e);
-                       throw new IMFatalException(ErrorCode.URL_PORT_IS_WRONG);
-               }
-       }
-
-       private SocketAddress getSocketAddress(String address, int port)
-                       throws IMFatalException {
-               SocketAddress addr = null;
-               try {
-                       addr = new InetSocketAddress(InetAddress.getByName(address), port);
-               } catch (UnknownHostException e) {
-                       Log.ExceptionLog(e);
-                       throw new IMFatalException(ErrorCode.URL_ADDRESS_IS_WRONG);
-
-               } catch (IllegalArgumentException e) {
-                       Log.ExceptionLog(e);
-                       throw new IMFatalException(ErrorCode.URL_PORT_IS_WRONG);
-
-               } catch (SecurityException e) {
-                       Log.ExceptionLog(e);
-
-                       ErrorController.setErrorMessage(e.getMessage());
-                       throw new IMFatalException(ErrorCode.URL_SECURITY_EXCEPTION);
-               }
-
-               return addr;
-       }
-
-       /**
-        * Get file size to download.
-        * 
-        * @return
-        */
-       public int getDownloadFileSize() {
-               if (mConnection == null) {
-                       return -1;
-               }
-
-               return mConnection.getContentLength();
-       }
-       
-       class ConnectionThread extends Thread {
-               URL url = null;
-               Proxy proxy = null;
-               
-               boolean connectionResult = false;
-               
-               public ConnectionThread(URL url, Proxy proxy) {
-                       this.url = url;
-                       this.proxy = proxy;
-               }
-               
-               public void run() {
-                       try {
-                               if (url != null) {
-                                       mConnection = url.openConnection(proxy);                                                
-                               }
-
-                               // set connetion timeout
-                               if (mConnection != null) {
-                                       mConnection.setConnectTimeout(CONNECT_TIMEOUT);
-                                       mConnection.setReadTimeout(READ_TIMEOUT);
-                                       mConnection.connect();
-                               }
-                               
-                               connectionResult = true;
-                       } catch (ConnectException e) {
-                               Log.ExceptionLog(e);
-                               ErrorController.setError(ErrorCode.INTERNET_CONNECTION_ERROR);
-
-                       } catch (NoRouteToHostException e) {
-                               Log.ExceptionLog(e);
-                               ErrorController.setError(ErrorCode.INTERNET_CONNECTION_ERROR);
-
-                       } catch (SocketTimeoutException e) {
-                               Log.ExceptionLog(e);
-                               ErrorController.setError(ErrorCode.SERVER_CONNECTION_TIME_OUT);
-
-                       } catch (SocketException e) {
-                               Log.ExceptionLog(e);
-                               ErrorController.setError(ErrorCode.INTERNET_CONNECTION_ERROR);
-
-                       } catch (FileNotFoundException e) {
-                               Log.ExceptionLog(e);
-                               ErrorController.setError(ErrorCode.CONFIG_CANNOT_FIND_PACKAGE_LIST_FILE_IN_REPOSITORY);
-                               
-                       } catch (SSLHandshakeException e) {
-                               Log.ExceptionLog(e);
-                               ErrorController.setError(ErrorCode.NOT_SUPPORT_HTTPS_PROTOCOL);
-                               
-                       } catch (NoSuchElementException e) {
-                               Log.ExceptionLog(e);
-                       } catch (IOException e) {
-                               Log.ExceptionLog(e);
-                       } catch (Throwable e) {
-                               Log.ExceptionLog(e);
-                       }
-               }
-               
-               public boolean getConnectionResult() {
-                       return connectionResult;
-               }
-       }
-}
diff --git a/SdkImageCreator/src/org/tizen/installmanager/lib/ErrorController.java b/SdkImageCreator/src/org/tizen/installmanager/lib/ErrorController.java
deleted file mode 100644 (file)
index 93db158..0000000
+++ /dev/null
@@ -1,254 +0,0 @@
-/*
-*  InstallManager
-*
-* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
-*
-* Contact:
-* Wooyoung Cho <wooyoung1.cho@samsung.com>
-* Shihyun Kim <shihyun.kim@samsung.com>
-* Taeyoung Son <taeyoung2.son@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.lib;
-
-import org.tizen.installmanager.core.Config;
-
-/**
- * This class manages error codes and states
- *
- * @author Shihyun Kim <shihyun.kim@samsung.com>
- */
-public class ErrorController {
-       /**
-        * Define case of error
-        *
-        * @author Shihyun Kim <shihyun.kim@samsung.com>
-        *
-        */
-       public enum ErrorCode {
-               CANNOT_FIND_CONFIG_FILE("The installmanager.conf file not found."),
-               CANNOT_FIND_FILE_IN_REPOSITROY("Cannot connect to SDK package server."),
-               CANNOT_CREATE_DOWNLOAD_FILE("Download file cannot be created."),
-               CANNOT_CHECK_INSTLLED_FILE_LIST("Installed file list cannot be checked."),
-               CANNOT_MOVE_FILE_TO_TARGET_DIRECTORY("File cannot be moved to the target directory."),
-               CANNOT_CONNECT_TO_PROXY_SERVER("Proxy server connection fails."),
-               WRONG_PACKAGE_URL("Package URLs are invalid."),
-               CANCEL("Download canceled."),
-               ERROR("Unknown error."),
-               UNKNOWN_PACKAGE_EXTENSION("Package extension not supported."),
-               INVALID_PACKAGE_VERSION("Invalid package version."),
-               CANNOT_FIND_INSTALLABLE_OR_REMOVABLE_PACKAGES("Install or uninstall packages not found. Network connection may have failed."),
-               CANNOT_FIND_FILE_IN_LOCAL("Local file not found."),
-               CANNOT_SAVE_CONFIG("Configuration file cannot be saved."),
-               CANNOT_CREATE_SHORTCUT("Shortcut creation failed."),
-               CANNOT_CREATE_INSTALL_LIST("Install list creation failed."),
-               CANNOT_CREATE_CONFIG_FILE("Configuration directory or file creation failed."),
-               CANNOT_FIND_USER_CONFIG_FILE("User configuration file creation failed."),
-               CANNOT_REGISTER_TARGET_DIR("Target directory registration failed."),
-               CANNOT_PARSING_TEXT("Configuration file parsing failed."),
-               CANNOT_SAVE_PROPERTY_FILE("The installmanager.conf or Package file cannot be saved."),
-               CANNOT_UNPACK_PACKAGE("The package.zip file unpackaging failed."),
-               CANNOT_CREATE_RESOURCE("Resource file creation failed."),
-               CANNOT_FIND_PACKAGE("Required packages not found. The package server may be invalid."),
-               CANNOT_REMOVE_PACKAGE("Package removal failed."),
-               CANNOT_REMOVE_MISSING_PACKAGE("Missing package cannot be removed."),
-               CANNOT_ACCESS_FILE("File access failed."),
-               CANNOT_REMOVE_OLDSDK("Old SDK removal failed."),
-               COPY_FILE_IS_FAIL("Copying the file to the target directory failed."),
-               OLD_TIZEN_SDK_EXISTS("Old Tizen SDK is installed. Remove the old SDK and run the Tizen SDK Install Manager again."),
-               UNSUPPORTED_PLATFORM("Platform not supported."),
-               REMOVE_SCRIPT_NOT_EXISTS("Removal script not found."),
-               REMOVE_SCRIPT_FATAL_ERROR("Fatal error occurred while uninstalling the Tizen SDK."),
-               INSTALLATION_FAIL("Installation failed."),
-               INSTALL_CANCELED("Installation canceled."),
-               INSTALLED_VERSION_IS_HIGH("Installation progress failed due to high installed package version."),
-               CANNOT_CREATE_FILE("File creation failed."),
-               THREAD_INTERRUPTED("Thread execution interrupted."),
-               CIRCULAR_PACKAGE_DEPENDENCY("Circular package dependency detected."),
-               
-               //Configuration file error
-               CONFIG_CANNOT_PARSING_PACKAGE_LIST("Package list cannot be read. Check the repository or proxy server."),
-               CONFIG_CANNOT_FIND_PACKAGE_LIST_FILE_IN_REPOSITORY("Package list file not found in the repository."),
-               CONFIG_CANNOT_REMOVE_CONFLICT_PACKAGES("Conflict package removal failed."),
-               CONFIG_CANNOT_REMOVE_UPDATABLE_PACKAGES("Updatable package removal failed."),
-               CONFIG_CANNOT_READ_SERVER_TYPE("Server type cannot be read. Check the server type in the installmanager.conf file."),
-               
-               //Package error
-               PACKAGE_WRONG_SIZE("Package size incorrect."),
-               PACKAGE_WRONG_CHECKSUM("Package file checksum error."),
-               PACKAGE_NOT_EXIST_TO_INSTALL_OR_UNINSTALL("Install or uninstall package not found."),
-               INSTALL_SCRIPT_NOT_EXISTS("Install script files not found."),
-               INSTALL_SCRIPT_FATAL_ERROR("Fatal error occurred while installing the Tizen SDK."),
-               
-               // Network error
-               INTERNET_CONNECTION_ERROR("Server connection failed. Check the network status or try again with the '-proxy <address>:<port>'."),
-               SERVER_CONNECTION_TIME_OUT("Server connection timed out."),
-               PROXY_NOT_PROVIDED("Proxy setting missing. Use the '-proxy <proxy-address>:<port>' option."),
-               PROXY_SERVER_IS_WRONG("Proxy server connection failed. Check the proxy server."),
-               PROXY_CONNECT_ERROR("Proxy server connection failed. Check the proxy server."),
-               URL_SECURITY_EXCEPTION("Proxy server URL security error."),
-               URL_ADDRESS_IS_WRONG("Incorrect URL."),
-               URL_PORT_IS_WRONG("Incorrect port number."),
-               NO_ROUTE_TO_HOST("Server not found. Check the URL."),
-               NOT_LOGGED_IN("Login failed."),
-               NOT_SUPPORT_HTTPS_PROTOCOL("HTTPS not supported."),
-               
-               //Http Socket error message
-               HTTP_ERROR_MESSAGE_403("403 Forbidden is returned by http protocol. " +
-                               "The server can be reached, but the server declined to allow access to the page."),
-               HTTP_ERROR_MESSAGE_401("Server requires authentication."),
-               
-               //option
-               WRONG_OPTION("Incorrect option. Check it."),
-               USESNAPSHOT_REPOSITORY_NOT_PROVIDED("Repository setting is missing. Use the '-snapShot <repository>' option."),
-               REPOSITORY_NOT_PROVIDED("Repository setting is missing. Use the '-repository <repository>' option."),
-               PACKAGES_NOT_PROVIDED("Repository setting is missing. Use the '-proxy <repository>' option."),
-               
-               //etc
-               CANNOT_FIND_INSTALLED_FILE_LIST("Installation file list not found."),
-               CANNOT_REMOVE_TARGET_DIR("Target directory removal failed."),
-               INSTALLATION_STOP("Required packages for the META package not installed."),
-               UNINSTALLATION_FAIL("Uninstallation failed."),
-               FILE_NOT_FOUND("File not found."),
-               REMOVE_OLD_SDK_OK("Old SDK uninstallation completed. Restart Install Manager."),
-               INVALID_INSTALL_PATH("Invalid installation path."),
-               DOWNLOAD_AND_EXIT("Packages downloaded successfully. Exit Install Manager."),
-               CANNOT_DOWNLOAD_FILE("File download failed."),
-               CANNOT_FIND_JAVA("\'JAVA\' not found. Check the java installation."),
-               UNKOWN_ERROR("Unknown error."),
-               NO_ERROR("Install Manager error. Send the log file to the Tizen SDK team."),
-               ERROR_TEMP("Information retrieval from the default SDK package server failed.\n In Advanced Configuration, select the package server and distribution."),
-               
-               SNAPSHOT_PATH_IS_NULL("Snapshot path missing."),
-               FAIL_TO_EXTRACT_SDK_IMAGE_FILE("SDK image file extraction failed."),
-               
-               //Using add extra repository dialog
-               SPACE_IN_REPOSITORY_NAME("Name cannot contain spaces."),
-               NOTHING_TO_REPOSITORY_NAME("Name must be more than 1 character long."),
-               HANGUL_IN_REPOSITORY_NAME("Repository name must be in English."),
-               WRONG_PACKAGE_SERVER("Package list files not found. Check the package list files on the package server."),
-               WRONG_PACKAGE_LIST_FORMAT("Mandatory field missing in the package list file."),
-               WRONG_URL_FORMAT_HTTP("URL must begin with 'http://'."),
-               WRONG_URL_FORMAT("Incorrect URL format. Enter the URL in the correct format."),
-               CANNOT_CONNECT_URL_ADDRESS("Connection to the URL failed. Enter the correct URL."),
-               PACKAGE_NOT_IN_EXTENSION_SERVER("Package file not found on the package server."),
-               OVERLAP_EXTENSION_REPOSITORY("Extension repository URL already exists.\nEnter a different extension repository URL."),
-               OVERLAP_BUILT_IN_EXTENSION_REPOSITORY("Built-in extension repository URL already exists.\nEnter a different extension repository URL.");
-               
-               private String errorMessage = "";
-
-               ErrorCode(String arg) {
-                       errorMessage = arg;
-               }
-
-               public String getErrorMessage() {
-                       return errorMessage;
-               }
-               
-               public void setErrorMessage(String msg) {
-                       errorMessage = msg;
-               }
-       }
-       
-       static public boolean isInstallManagerUpdatable = false;
-
-
-       static private ErrorCode mErrorCode = ErrorCode.NO_ERROR;
-       static private boolean mInstallationStatus = true;
-       static private String errorMsg = "";
-
-       private static int exitCode = Config.EXITCODE_NORMAL;
-
-       /**
-        * Set error code.
-        * @param errorCode
-        */
-       static public void setError(ErrorCode errorCode) {
-               mErrorCode = errorCode;
-       }
-
-       /**
-        * 
-        * @return Latest error message.
-        */
-       static public String getErrorMessage() {
-               if (mErrorCode != null) {                       
-                       return mErrorCode.getErrorMessage();
-               } else {
-                       return errorMsg;
-               }
-       }
-       
-       static public void setErrorMessage(String msg) {
-               mErrorCode = null; 
-               errorMsg = msg;
-       }
-
-       /** 
-        * @return Latest error code.
-        */
-       static public ErrorCode getErrorCode() {
-               return mErrorCode;
-       }
-
-       /**
-        * Set status of installation.
-        * @param status
-        */
-       static public void setInstallationSuccess(boolean status) {
-               Log.log("Set installation success: "+status);
-               if (status == true) {
-                       mErrorCode = null;
-               }
-               mInstallationStatus = status;
-       }
-
-       /**
-        * Get status of installation.
-        * @return
-        */
-       static public boolean checkInstallationSuccess() {
-               return mInstallationStatus;
-       }
-
-       /**
-        * Get error message of e
-        * @param e
-        * @return
-        */
-       public static String getMessage(ErrorCode e) {
-               return e.getErrorMessage();
-       }
-
-       /**
-        * Sets exit code to be used on exit
-        * @param exitCode
-        */
-       public static void setExitCode(int exitCode) {
-               ErrorController.exitCode = exitCode;
-       }
-
-       /**
-        * Gets exit code to be used on exit
-        */
-       public static int getExitCode() {
-               return ErrorController.exitCode;
-       }
-}
diff --git a/SdkImageCreator/src/org/tizen/installmanager/lib/IFileSystemInformation.java b/SdkImageCreator/src/org/tizen/installmanager/lib/IFileSystemInformation.java
deleted file mode 100644 (file)
index 11c601e..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
-*  InstallManager
-*
-* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
-*
-* Contact: 
-* Wooyoung Cho <wooyoung1.cho@samsung.com>
-* Shihyun Kim <shihyun.kim@samsung.com>
-* Taeyoung Son <taeyoung2.son@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.lib;
-
-import java.io.File;
-import java.util.List;
-
-/**
- * Provide information of file system.
- * 
- * @author Taeyoung Son <taeyoung2.son@samsung.com>
- *
- */
-public interface IFileSystemInformation {
-       /**
-        * @author Taeyoung Son <taeyoung2.son@samsung.com>
-        */
-       enum FileSystemType {
-
-               UNKNOWN,
-               NTFS,
-               FAT32,
-               FAT16,
-               EXT2,
-               EXT3,
-               EXT4
-       };
-       
-       /**
-        * Get list of mount drive.
-        * @return
-        */
-       public List<File> getListMounts();
-       /**
-        * Get list of device.
-        * @return
-        */
-       public File[] getListDevices();
-       /**
-        * Get file system type.
-        * @param disk
-        * @return enum value of FileSystemType.
-        */
-       public FileSystemType getFileSystemType(File disk);
-}
diff --git a/SdkImageCreator/src/org/tizen/installmanager/lib/IIMProgressMonitor.java b/SdkImageCreator/src/org/tizen/installmanager/lib/IIMProgressMonitor.java
deleted file mode 100644 (file)
index b6f4a79..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
-*  InstallManager
-*
-* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
-*
-* Contact: 
-* Wooyoung Cho <wooyoung1.cho@samsung.com>
-* Shihyun Kim <shihyun.kim@samsung.com>
-* Taeyoung Son <taeyoung2.son@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.lib;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-
-/**
- * If you want to express in UI, implement this interface and exchange information from this.
- * 
- * @author Shihyun Kim <shihyun.kim@samsung.com>
- *
- */
-public interface IIMProgressMonitor extends IProgressMonitor{
-       /**
-        * set name of package.
-        * @param name
-        */
-       public void setPackageName(String name);
-       /**
-        * set file name while installing or uninstalling
-        * @param name
-        */
-       public void setFileName(String name);
-       /**
-        * Display file name to UI.
-        */
-       public void workedFileName();
-       /**
-        * Display download size to UI.
-        * @param size
-        */
-       public void workedDownload(long size);
-       /**
-        * Display checksum size to UI.
-        * @param size
-        */
-       public void workedChecksum(final long size);
-       /**
-        * Set start time to download.
-        * It can be used remaining time or download speed.
-        * @param startTime
-        */
-       public void setDownloadStartTime(long startTime);
-       /**
-        * Display progressbar to UI.
-        * @param percent
-        */
-    public void workedProgressbar(int percent);
-}
diff --git a/SdkImageCreator/src/org/tizen/installmanager/lib/IMError.java b/SdkImageCreator/src/org/tizen/installmanager/lib/IMError.java
deleted file mode 100644 (file)
index 5086f62..0000000
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
-*  InstallManager
-*
-* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
-*
-* Contact: 
-* Wooyoung Cho <wooyoung1.cho@samsung.com>
-* Shihyun Kim <shihyun.kim@samsung.com>
-* Taeyoung Son <taeyoung2.son@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.lib;
-
-import java.io.File;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.MessageBox;
-import org.tizen.installmanager.ui.InstallManagerWindow;
-import org.tizen.installmanager.ui.page.CompletePage;
-
-
-/**
- * This exception is thrown when error occurs.
- * 
- * @author Wooyoung Cho <wooyoung1.cho@samsung.com>
- *
- */
-public class IMError {
-
-       private static Composite mParent;
-       
-
-       private MessageBox mMessageBox;
-       
-       /**
-        * set composite to display.
-        * @param parent
-        */
-       public static void setComposite(Composite parent) {
-               mParent = parent;
-       }
-       
-       /**
-        * This exception is thrown when error occurs before making UI page.
-        * @param message
-        */
-       public static void fatalError(final String message) {
-               final InstallManagerWindow window = InstallManagerWindow.getInstallManagerWindow();
-               window.getShell().getDisplay().asyncExec(new Runnable() {
-                       public void run() {
-                               CompletePage completePage = window.getCompletePage();
-                               completePage.showCheckButton(false);
-                               window.setCancelBtnEnabled(true);
-                               window.showComposite(completePage);
-                               completePage.setTitle("Installation Error");
-                               completePage.setCustomErrorMessage(message);
-                       }
-               });
-
-    }
-       
-       /**
-        * Show warning dialog.
-        * @param message Display message in dialog.
-        */
-       public void warning(String message) {
-               warningBox(message);
-       }
-       
-       /**
-        * Show warning dialog when file is not exist.
-        * @param file
-        */
-       public void noFile(File file) {
-               String message = file.getName() + "is not exist";
-               
-               warningBox(message);
-       }
-       
-       private void warningBox(String message) {
-               mMessageBox = new MessageBox(mParent.getShell(), SWT.ICON_WARNING  | SWT.OK);
-               mMessageBox.setText("Warning");
-               
-               message = "Warning : " + message;
-               messageBox(message);
-       }
-       
-       private void messageBox(String message) {
-               mMessageBox.setMessage(message);
-               mMessageBox.open();
-       }
-}
diff --git a/SdkImageCreator/src/org/tizen/installmanager/lib/Log.java b/SdkImageCreator/src/org/tizen/installmanager/lib/Log.java
deleted file mode 100644 (file)
index 5bff941..0000000
+++ /dev/null
@@ -1,229 +0,0 @@
-/*
- *  InstallManager
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: 
- * Wooyoung Cho <wooyoung1.cho@samsung.com>
- * Shihyun Kim <shihyun.kim@samsung.com>
- * Taeyoung Son <taeyoung2.son@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.lib;
-
-import java.io.*;
-import java.util.Arrays;
-import java.util.Comparator;
-import java.util.Date;
-import java.text.SimpleDateFormat;
-
-import org.tizen.installmanager.core.Config;
-import org.tizen.installmanager.util.PathUtil;
-
-/**
- * Manages log message.
- * 
- * @author Yongsung Kim <yongsung1.kim@samsung.com>
- * 
- */
-public class Log {
-       private static File mLogFile;
-       private static String newLine = "";
-
-       private static FileWriter objfile = null;
-       private final static Date startTime = new Date();
-       private final static String logfileNameHead = "tizen_installmanager";
-
-       // log file dir
-       private final static String LOG_FILE_DIRECTORY = "install-log";
-
-       static {
-               if (Platform.CURRENT_PLATFORM == Platform.LINUX_32
-                               || Platform.CURRENT_PLATFORM == Platform.LINUX_64) {
-                       newLine = "\n";
-               } else {
-                       newLine = "\r\n";
-               }
-       }
-       
-       /**
-        * This function must be before Logging. Create log file.
-        */
-       public static void open() {
-               removeTooOldLogs();
-
-               // open log file
-               mLogFile = new File(PathUtil.get(
-                               Config.CONFIG_HOME,
-                               LOG_FILE_DIRECTORY,
-                               logfileNameHead
-                                               + "_"
-                                               + new SimpleDateFormat("yyyyMMdd-HHmmss")
-                                                               .format(startTime) + ".log"));
-               File parentDir = mLogFile.getParentFile();
-               if (!parentDir.exists()) {
-                       parentDir.mkdirs();
-               }
-
-               try {
-                       mLogFile.createNewFile();
-               } catch (IOException e) {
-                       // log file is not create.
-                       return;
-               }
-
-               try {
-                       objfile = new FileWriter(mLogFile);
-               } catch (IOException e1) {
-                       // log file is not create.
-                       return;
-               }
-
-       }
-
-       /**
-        * remove logs except latest 5 logs
-        */
-       private static void removeTooOldLogs() {
-               File confDir = new File(PathUtil.get(
-                               Config.CONFIG_HOME,
-                               LOG_FILE_DIRECTORY));
-               
-               File[] logs = confDir.listFiles(new FileFilter() {
-
-                       @Override
-                       public boolean accept(File file) {
-                               return file.getAbsolutePath().contains(logfileNameHead);
-                       }
-
-               });
-               if (logs == null) {
-                       return;
-               }
-               Arrays.sort(logs, new Comparator<File>() {
-
-                       @Override
-                       public int compare(File arg0, File arg1) {
-                               return arg0.compareTo(arg1);
-                       }
-
-               });
-
-               for (int i = 0; i < logs.length - 5; i++) {
-                       logs[i].delete();
-               }
-
-       }
-
-       /**
-        * This function must be after Logging
-        */
-       public static void close() {
-               try {
-                       if (objfile != null) {
-                               objfile.flush();
-                               objfile.close();
-                       }
-               } catch (IOException e) {
-                       // ignore
-                       return;
-               }
-       }
-
-       /**
-        * Logging title
-        */
-       public static void LogTitle(String msg) {
-               if (objfile == null) {
-                       return;
-               }
-               StringBuffer bufLogTitle = new StringBuffer();
-
-               bufLogTitle.append("**********************  ");
-               bufLogTitle.append(msg);
-               bufLogTitle.append("  **********************");
-
-               try {
-                       objfile.write(bufLogTitle.toString());
-                       objfile.write(newLine);
-                       objfile.flush();
-               } catch (IOException e) {
-               }
-       }
-
-       /**
-        * Tracing Log Method
-        */
-       public static void log(String msg) {
-               write("[Trace] " + msg);
-       }
-
-       /**
-        * Error Log Method
-        */
-       public static void err(String msg) {
-               write("[Error] " + msg);
-       }
-
-       /**
-        * Exception Log Method
-        */
-       public static void ExceptionLog(Throwable e) {
-               write("[Excep] " + e);
-               PrintWriter pw = new PrintWriter(objfile);
-               e.printStackTrace(pw);
-       }
-
-       /**
-        * Write a string to logfile with timestamp
-        * 
-        * @param str
-        */
-       private static void write(String str) {
-               if (objfile == null) {
-                       return;
-               }
-
-               try {
-                       objfile.write(timeStr() + " " + str);
-                       objfile.write(newLine);
-                       objfile.flush();
-               } catch (IOException e) {
-
-               }
-       }
-
-       /**
-        * @return time string
-        */
-       private static String timeStr() {
-               return getTimeStr();
-       }
-       
-       private static String getTimeStr() {
-               String timeStr = getFormatter().format(new Date());
-               return timeStr;
-       }
-       
-       private static SimpleDateFormat getFormatter() {
-               SimpleDateFormat formatter = new SimpleDateFormat("HH:mm:ss");
-               return formatter;
-       }
-}
diff --git a/SdkImageCreator/src/org/tizen/installmanager/lib/LoggerShellParser.java b/SdkImageCreator/src/org/tizen/installmanager/lib/LoggerShellParser.java
deleted file mode 100644 (file)
index f444cb8..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
-*  InstallManager
-*
-* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
-*
-* Contact: 
-* Wooyoung Cho <wooyoung1.cho@samsung.com>
-* Shihyun Kim <shihyun.kim@samsung.com>
-* Taeyoung Son <taeyoung2.son@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.lib;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-
-/**
- * Logs shell stdout and stderr
- * @author Wooyoung Cho <wooyoung1.cho@samsung.com>
- *
- */
-public class LoggerShellParser extends ShellParser {
-       
-       public LoggerShellParser() {
-       }
-       
-       public LoggerShellParser(boolean isJoin) {
-               super(isJoin);
-       }
-       
-       /**
-        * Logs stdout
-        * @param input standard out stream
-        */
-       protected void parseStdOut(InputStream input) {
-               BufferedReader br = null;
-               try {
-            InputStreamReader isr = new InputStreamReader(input, Platform.CURRENT_CHARSET);
-            br = new BufferedReader(isr);
-            
-            String line;
-            while ( (line = br.readLine()) != null) {
-               Log.log("STDOUT> "+line);
-            }
-        } catch (IOException ioe) {
-                       Log.err("LoggerShellParser fail to parse stdout stream.");
-        } finally{
-               if (br != null) {
-                               try {                                   
-                                       br.close();
-                               } catch (IOException e) {
-                                       Log.err("LoggerShellParser fail to close stdout stream.");
-                               } 
-                       }
-        }
-       }
-       
-       /**
-        * Logs stderr
-        * @param input standard error stream
-        */
-       protected void parseStdErr(InputStream input) {
-               BufferedReader br = null;
-               try {
-            InputStreamReader isr = new InputStreamReader(input, Platform.CURRENT_CHARSET);
-            br = new BufferedReader(isr);
-            
-            String line;
-            while ( (line = br.readLine()) != null) {
-               Log.log("STDERR> "+line);
-            }
-        } catch (IOException ioe) {
-               Log.err("LoggerShellParser fail to parse stderr stream.");
-        }finally{
-               if (br != null) {
-                               try {                                   
-                                       br.close();
-                               } catch (IOException e) {
-                                       Log.err("LoggerShellParser fail to close stderr stream.");
-                               } 
-                       }
-        }
-       }
-       
-}
diff --git a/SdkImageCreator/src/org/tizen/installmanager/lib/NetworkProxy.java b/SdkImageCreator/src/org/tizen/installmanager/lib/NetworkProxy.java
deleted file mode 100644 (file)
index 941c3c9..0000000
+++ /dev/null
@@ -1,144 +0,0 @@
-package org.tizen.installmanager.lib;
-
-import java.net.InetSocketAddress;
-import java.net.Proxy;
-import java.net.ProxySelector;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.util.List;
-
-import org.tizen.installmanager.core.IMFatalException;
-import org.tizen.installmanager.lib.ErrorController.ErrorCode;
-
-
-/**
- * 
- * Get network proxy address from ProxySelector class.
- * If you create NetworkProxy instance without ProxySelector instance, 
- * you can get system proxy from select function.
- * @author Shihyun Kim<shihyun.kim@samsung.com>
- *
- */
-public class NetworkProxy{
-       public static boolean useProxy = true;
-       
-       private static NetworkProxy netProxy = null;
-       private static final String PROXY_PROPERTY = "java.net.useSystemProxies";
-       
-       //member variable
-       private ProxySelector proxySelector = null;
-       
-       private NetworkProxy(ProxySelector selector) {
-               proxySelector = selector;
-       }
-       
-       /**
-        * Get proxy list from <code>url</code> parameter.
-        * @param url
-        * @return list of proxy from ProxySelector.
-        */
-       public List<Proxy> select(URL url) {
-               
-               try {
-                       return select(url.toURI());
-               } catch (URISyntaxException e) {
-                       Log.err("Cannot get proxy => " + url);
-                       return null;
-               }
-       }
-       
-       /**
-        * Get proxy list from <code>uri</code> parameter.
-        * @param uri
-        * @return list of proxy from ProxySelector.
-        */
-       public List<Proxy> select(URI uri) {            
-               if (uri == null) {
-                       Log.err("uri is null");
-                       return null;
-               }
-               
-               
-               Log.log("proxy select uri => " + uri.toString());
-               
-               try {
-                       if (proxySelector == null) {                                    
-                               return ProxySelector.getDefault().select(uri);
-                       } else {
-                               return proxySelector.select(uri);
-                       }
-               } catch (IllegalArgumentException e) {
-                       Log.ExceptionLog(e);
-                       return null;
-               } catch (Exception e) {
-                       Log.ExceptionLog(e);
-                       return null;
-               }
-       }
-       
-       /**
-        * Get direct Proxy instance.
-        * @param url is connected by proxy.
-        * @return Direct proxy instance.
-        */
-       public static Proxy getHttpDirectProxy(URL url) {
-               String host = url.getHost();
-               int port = url.getPort();
-               if (port < 0) {
-                       port = url.getDefaultPort();
-               }
-               
-               Proxy directProxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(host, port));
-               return directProxy;
-       }
-       
-       /**
-        * Get system proxy list to connect. 
-        * @param url
-        * @return
-        */
-       public static List<Proxy> getSystemProxyList(URL url) {
-               String proxyPropertyBefore = System.getProperty(PROXY_PROPERTY);
-               /*
-                * "useSystemProxies" property set true.
-                * because get the system proxy in ProxySelector class.
-                */
-               System.setProperty(PROXY_PROPERTY, "true");
-               
-               NetworkProxy netProxy = NetworkProxy.getInstance(ProxySelector.getDefault());
-       
-               // get system proxy from NetworkProxy class
-               List<Proxy> proxyList = null;
-               try {
-                       proxyList = netProxy.select(url.toURI());
-               } catch (URISyntaxException e) {
-                       Log.ExceptionLog(e);
-               }
-               
-               if (proxyPropertyBefore != null) {
-                       System.setProperty(PROXY_PROPERTY, proxyPropertyBefore);
-               } else {
-                       System.setProperty(PROXY_PROPERTY, "null");
-               }
-               
-               if (proxyList == null) {
-                       throw new IMFatalException(ErrorCode.INTERNET_CONNECTION_ERROR);
-               } else {
-                       Log.log("Proxy list => " + proxyList);
-                       return proxyList;
-               }
-       }
-       
-       public static NetworkProxy getInstance(ProxySelector selector) {
-               if (netProxy == null) {
-                       netProxy = new NetworkProxy(selector);
-               }
-               
-               return netProxy;
-       }
-}
-
-
-
-
diff --git a/SdkImageCreator/src/org/tizen/installmanager/lib/OldRegistry.java b/SdkImageCreator/src/org/tizen/installmanager/lib/OldRegistry.java
deleted file mode 100644 (file)
index 541c939..0000000
+++ /dev/null
@@ -1,278 +0,0 @@
-/*
-*  InstallManager
-*
-* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
-*
-* Contact: 
-* Wooyoung Cho <wooyoung1.cho@samsung.com>
-* Shihyun Kim <shihyun.kim@samsung.com>
-* Taeyoung Son <taeyoung2.son@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.lib;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.prefs.Preferences;
-
-import org.tizen.installmanager.core.IMFatalException;
-import org.tizen.installmanager.lib.ErrorController.ErrorCode;
-import org.tizen.installmanager.lib.win.WindowsRegistry;
-import org.tizen.installmanager.util.IMShellCommandFail;
-import org.tizen.installmanager.util.PathUtil;
-import org.tizen.installmanager.util.ShellUtil;
-
-
-/**
- * This class purpose to remove old version tizen sdk.
- * @author Shihyun Kim <shihyun.kim@samsung.com>
- *
- */
-public class OldRegistry{
-       List<RegistryInfo> oldRegistryInfo = new ArrayList<RegistryInfo>();
-       RegistryInfo mCurrentRegistry = null;
-       
-       boolean isWindowsRegistry = false;
-       
-       private class RegistryInfo {
-               String mRegistryPath = "";
-               String mPathKey = "";
-               String mTargetPath = "";
-               
-               RegistryInfo(String registryPath, String pathKey) {
-                       mRegistryPath = registryPath;
-                       mPathKey = pathKey;
-               }
-               
-               void setTargetPath(String targetPath) {
-                       mTargetPath = targetPath;
-               }
-       }
-       
-       public OldRegistry() {
-               setOldRegistryInfo();
-               mCurrentRegistry = getCurrentRegistry();
-       }
-       
-       //You have to add additional old IM to this method
-       private List<RegistryInfo> setOldRegistryInfo() {
-               //file fist parameter is file path, second parameter is key of installed-path
-               oldRegistryInfo.add(new RegistryInfo(PathUtil.getFromHome(".slpsdk"), "SLP_SDK_INSTALL_PATH"));
-               oldRegistryInfo.add(new RegistryInfo(PathUtil.getFromHome(".tizensdk"), "TIZEN_SDK_INSTALL_PATH"));
-               
-               //windows registry
-               oldRegistryInfo.add(new RegistryInfo("", "tizensdk-installpath"));
-               oldRegistryInfo.add(new RegistryInfo("", "slpsdk-installpath"));
-               
-               return oldRegistryInfo;
-       }
-       
-       /**
-        * Get target directory of old tizen sdk.
-        * @return
-        */
-       public String getOldTargetPath() {
-               if (mCurrentRegistry == null) {
-                       return "";
-               } else {}//old IM is exists in local
-               
-               return mCurrentRegistry.mTargetPath;
-       }
-
-       /**
-        * Check the old tizen sdk, exist or not.
-        * @return <code>true</code> if exist old tizen sdk.
-        */
-       public boolean exists() {
-               if (mCurrentRegistry == null) {
-                       return false;
-               } else {
-                       return true;
-               }
-       }
-       
-       private RegistryInfo getCurrentRegistry() {
-               for (RegistryInfo info : oldRegistryInfo) {
-                       String targetPath = null;
-                       if (info.mRegistryPath == null || info.mRegistryPath.isEmpty()) {
-                               targetPath = getTargetPathFromWindowsRegistry(info);
-                               
-                               if (targetPath == null) {
-                                       continue;
-                               }
-                       } else {
-                               File oldFile = new File(info.mRegistryPath);
-                               if (oldFile.exists()) {
-                                       targetPath = getTargetPathFromFile(info);
-                               } else {
-                                       continue;
-                               }
-                       }
-                       
-                       File targetDirFile = new File(targetPath);
-                       if (!targetDirFile.exists()) {
-                               Log.log(info.mRegistryPath + " file exists, but " + targetPath + " path doesn't.");
-                               return info;
-                       } else {
-                               info.setTargetPath(targetPath);
-                               return info;
-                       }
-               }
-               
-               return null;
-       }
-       
-       private String getTargetPathFromWindowsRegistry(RegistryInfo info) {
-               if (Platform.CURRENT_PLATFORM != Platform.WINDOWS_32) {
-                       return null;
-               }
-               
-               String targetPath = Preferences.userRoot().get(info.mPathKey, null);
-               if (targetPath == null) {
-                       return null;
-               } else {
-                       return targetPath;
-               }
-       }
-       
-       private String getTargetPathFromFile(RegistryInfo info) {
-               String targetPath = getPathFromRegistryKey(info.mRegistryPath, info.mPathKey);
-               
-               return targetPath;
-       }
-       
-       private String getPathFromRegistryKey(String path, String registryKey) {
-       File file = new File(path);
-        
-        if (!file.exists() || !file.isFile()) {
-               return "";
-        }
-
-        FileInputStream fis = null;
-        InputStreamReader isr = null;
-        BufferedReader br = null;
-
-        String readLine;
-        String result = "";
-        try {
-            fis = new FileInputStream(file);
-            isr = new InputStreamReader(fis);
-            br = new BufferedReader(isr);
-
-            while ((readLine = br.readLine()) != null) {
-                if (readLine.startsWith(registryKey)) {
-                    int startChar = readLine.indexOf("=");
-                    if(startChar == -1) {
-                       Log.err("OldRegistry.getPathFromRegistryKey() Invalid registry file => " + path + ", " + registryKey);
-                       throw new IMFatalException("Invalid registry file");
-                    }
-                    result = readLine.substring(startChar+1);
-                }
-            }
-
-            return result;
-        } catch (IOException ioe) {
-               Log.err("OldRegistry.getPathFromRegistryKey() Cannot read install path from .tizensdk file => " + path + ", " + registryKey);
-            throw new IMFatalException("Cannot read install path from .tizensdk file");
-        } finally {
-            if (br != null) {
-                try {
-                       br.close();
-                               } catch (IOException e) {
-                                       Log.ExceptionLog(e);
-                               }               
-            }
-            
-            if (isr != null) {
-                try {
-                                       isr.close();
-                               } catch (IOException e) {
-                                       Log.ExceptionLog(e);
-                               }               
-            }
-
-            if (fis != null) {
-                try {
-                       fis.close();
-                               } catch (IOException e) {
-                                       Log.ExceptionLog(e);
-                               }               
-            }
-        }
-    }
-
-       /**
-        * Remove old tizen sdk.
-        */
-       public void remove() {
-               Log.log("Remove Old SDK start");
-               if(Platform.CURRENT_PLATFORM == Platform.LINUX_32
-                               || Platform.CURRENT_PLATFORM == Platform.LINUX_64
-                               || Platform.CURRENT_PLATFORM == Platform.MACOS_64) {
-                       
-                       try {
-                               File script = PathUtil.getTempFileFromResource("/res/desktop_directory/removeOldSDK.sh", "removeOldSDK", ".sh");
-                               script.setExecutable(true);
-                               Map<String, String> env = new HashMap<String, String>();
-                               env.put("INSTALLED_PATH", getOldTargetPath());
-                               try {
-                                       ShellUtil.execute(script.getAbsolutePath(), env, null, new LoggerShellParser());
-                               } catch (IMShellCommandFail e) {
-                                       Log.ExceptionLog(e);
-                                       throw new IMFatalException(ErrorCode.CANNOT_REMOVE_OLDSDK);
-                               }
-                       } catch (IOException e) {
-                               Log.ExceptionLog(e);
-                               throw new IMFatalException(ErrorCode.CANNOT_REMOVE_OLDSDK);
-                       }
-               } else if(Platform.CURRENT_PLATFORM == Platform.WINDOWS_32
-                               || Platform.CURRENT_PLATFORM == Platform.WINDOWS_64) {
-                       WindowsRegistry.removeRegistry("slpsdk-installpath");
-                       WindowsRegistry.removeRegistry("tizensdk-installpath");
-                       
-                       try {
-                               File script = PathUtil.getTempFileFromResource("/res/desktop_directory/removeOldSDK.vbs", "removeOldSDK", ".vbs");
-                               script.setExecutable(true);
-                               Map<String, String> env = new HashMap<String, String>();
-                               env.put("INSTALLED_PATH", getOldTargetPath());
-                               try {
-                                       String command = ShellUtil.addInterpreter(script.getAbsolutePath());
-                                       ShellUtil.execute(command, env, null, new LoggerShellParser());
-                               } catch (IMShellCommandFail e) {
-                                       Log.ExceptionLog(e);
-                                       throw new IMFatalException(ErrorCode.CANNOT_REMOVE_OLDSDK);
-                               }
-                       } catch (IOException e) {
-                               Log.ExceptionLog(e);
-                               throw new IMFatalException(ErrorCode.CANNOT_REMOVE_OLDSDK);
-                       }
-               } else {
-                       throw new IMFatalException(ErrorCode.UNSUPPORTED_PLATFORM);
-               }
-               Log.log("Remove Old SDK finish");
-       }
-}
diff --git a/SdkImageCreator/src/org/tizen/installmanager/lib/Platform.java b/SdkImageCreator/src/org/tizen/installmanager/lib/Platform.java
deleted file mode 100644 (file)
index 8fc88df..0000000
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
- *  InstallManager
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: 
- * Wooyoung Cho <wooyoung1.cho@samsung.com>
- * Shihyun Kim <shihyun.kim@samsung.com>
- * Taeyoung Son <taeyoung2.son@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.lib;
-
-import org.tizen.installmanager.util.PathUtil;
-
-/**
- * Check the platform.
- * 
- * @author Shihyun Kim <shihyun.kim@samsung.com>
- * 
- */
-public class Platform {
-
-       // Code for each OS and bits
-       public static final int UNKNOWN    = 0;
-       public static final int LINUX_32   = 1;      // for normal Linux
-       public static final int LINUX_64   = 1 << 2;
-       public static final int WINDOWS_32 = 1 << 3; // for MS Windows
-       public static final int WINDOWS_64 = 1 << 4;
-       public static final int MACOS_32   = 1 << 5; // for Apple MacOS
-       public static final int MACOS_64   = 1 << 6;
-       public static final int UBUNTU_32  = 1 << 7; // for Ubuntu Linux
-       public static final int UBUNTU_64  = 1 << 8;
-       
-       // Code for generic OS
-       public static final int GENERIC_LINUX   = LINUX_32   | LINUX_64  | UBUNTU_32 | UBUNTU_64;
-       public static final int GENERIC_WINDOWS = WINDOWS_32 | WINDOWS_64;
-       public static final int GENERIC_MACOS   = MACOS_32   | MACOS_64;
-       public static final int GENERIC_UBUNTU  = UBUNTU_32  | UBUNTU_64;
-       
-
-       public static final int CURRENT_PLATFORM = getCurrentPlatform();
-       public static final String CURRENT_CHARSET = getCurrentCharset();
-
-       //data model
-       public static final String DATA_MODEL_32 = "32";
-       public static final String DATA_MODEL_64 = "64";
-       /**
-        * Get current platform. UNKOWN = 0, LINUX = 1, WINDOWS = 2, MAC_OS = 3
-        * TODO must check ubuntu or fedora.
-        * 
-        * @return
-        */
-       private static int getCurrentPlatform() {
-               String os = System.getProperty("os.name");
-               String dataModel = System.getProperty("sun.arch.data.model");
-
-               if (os.startsWith("Linux")) {
-                       if (dataModel.equals(DATA_MODEL_32)) {
-                               return LINUX_32;
-                       } else if (dataModel.equals(DATA_MODEL_64)) {
-                               return LINUX_64;
-                       }
-               } else if (os.startsWith("Windows")) {
-                       if (dataModel.equals(DATA_MODEL_32)) {
-                               return WINDOWS_32;
-                       } else if (dataModel.equals(DATA_MODEL_64)) {
-                               return WINDOWS_64;
-                       }
-               } else if (os.startsWith("Mac OS")) {
-                       return MACOS_64;
-               }
-
-               throw new RuntimeException("unknown Platform - " + os);
-       }
-
-       private static String getCurrentCharset() {
-               return System.getProperty("sun.jnu.encoding");
-       }
-
-       /**
-        * @return platform information
-        */
-       public static String getPlatformInfo() {
-               String info = "";
-               info = info + "OS Name: " + System.getProperty("os.name") + "\n";
-               info = info + "OS Version: " + System.getProperty("os.version") + "\n";
-               info = info + "Data Model: " + System.getProperty("sun.arch.data.model") + "\n";
-               if (Platform.CURRENT_PLATFORM == Platform.LINUX_32) {
-                       String filePath = "/etc/lsb-release";
-                       info = info + PathUtil.readAllTextFromFile(filePath) + "\n";
-               }
-               info = info + "java : " + System.getProperty("java.runtime.name")
-                               + "\n";
-               info = info + "vm version : " + System.getProperty("java.vm.version")
-                               + "\n";
-
-               return info;
-       }
-       
-       
-       /**
-        * Check whether current platform is linux.
-        * @return If current platform is linux, return true. If not, return false
-        */
-       public static boolean isLinux()
-       {
-               return ( CURRENT_PLATFORM & GENERIC_LINUX ) > 0;
-       }
-       
-       /**
-        * Check whether current platform is Ubuntu, but not implemented yet.
-        * TODO must implement soon.
-        * @return If current platform is Ubunut, return true. If not, return false
-        */
-       public static boolean isUbuntu()
-       {
-               return isLinux();
-       }
-       
-       
-       /**
-        * Check whether current platform is MacOS.
-        * @return If current platform is MacOS, return true. If not, return false
-        */
-       public static boolean isMacOS()
-       {
-               return ( CURRENT_PLATFORM & GENERIC_MACOS ) > 0;
-       }
-       
-       
-       /**
-        * Check whether current platform is linux.
-        * @return If current platform is MacOS, return true. If not, return false
-        */
-       public static boolean isWindows()
-       {
-               return ( CURRENT_PLATFORM & GENERIC_WINDOWS ) > 0;
-       }
-}
diff --git a/SdkImageCreator/src/org/tizen/installmanager/lib/ProgramController.java b/SdkImageCreator/src/org/tizen/installmanager/lib/ProgramController.java
deleted file mode 100644 (file)
index d115e15..0000000
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- *  InstallManager
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: 
- * Wooyoung Cho <wooyoung1.cho@samsung.com>
- * Shihyun Kim <shihyun.kim@samsung.com>
- * Taeyoung Son <taeyoung2.son@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.lib;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.tizen.installmanager.core.IMFatalException;
-import org.tizen.installmanager.lib.ErrorController.ErrorCode;
-import org.tizen.installmanager.lib.linux.LinuxProgramController;
-import org.tizen.installmanager.lib.mac.MacProgramController;
-import org.tizen.installmanager.lib.win.WindowsProgramController;
-
-/**
- * Manages process.
- * 
- * @author Shihyun Kim <shihyun.kim@samsung.com>
- * 
- */
-abstract public class ProgramController {
-
-       private static LinuxProgramController linuxController = new LinuxProgramController();
-       private static WindowsProgramController windowsController = new WindowsProgramController();
-       private static MacProgramController macController = new MacProgramController();
-
-       /**
-        * Terminates running SDK processes
-        */
-       abstract public void terminateRunningProgram();
-
-       /**
-        * @return list of pid strings.
-        */
-       abstract public List<Integer> getSDKPidList();
-
-       /**
-        * Checks if SDK processes are running
-        * 
-        * @return <code>true</code> if at least one SDK process is running
-        */
-       abstract public boolean runningProgramExists();
-
-       /**
-        * Removes unpack directory
-        * 
-        * @return <code>true</code> if success
-        */
-       abstract public boolean removeSDKTempDir();
-
-       /**
-        * Get instance in accordance with platform
-        * 
-        * @return
-        */
-       public static ProgramController createProgramController() {
-               if (Platform.CURRENT_PLATFORM == Platform.LINUX_32
-                               || Platform.CURRENT_PLATFORM == Platform.LINUX_64) {
-                       if (linuxController == null) {
-                               linuxController = new LinuxProgramController();
-                       }
-                       return linuxController;
-               } else if (Platform.CURRENT_PLATFORM == Platform.WINDOWS_32
-                               || Platform.CURRENT_PLATFORM == Platform.WINDOWS_64) {
-                       if (windowsController == null) {
-                               windowsController = new WindowsProgramController();
-                       }
-                       return windowsController;
-               } else if (Platform.CURRENT_PLATFORM == Platform.MACOS_64) {
-                       if (macController == null) {
-                               macController = new MacProgramController();
-                       }
-                       return macController;
-               } else {
-                       throw new IMFatalException(ErrorCode.UNSUPPORTED_PLATFORM);
-               }
-       }
-
-       /**
-        * set environment variable.
-        * 
-        * @param environmentSet
-        *            save key and value to environmentSet.
-        * @param key
-        * @param value
-        * @return environmentSet.
-        */
-       public static Map<String, String> setEnvironmentVariable(
-                       Map<String, String> environmentSet, String key, String value) {
-               if (environmentSet == null) {
-                       environmentSet = new HashMap<String, String>();
-               } else {
-               }
-
-               environmentSet.put(key, value);
-               return environmentSet;
-       }
-}
diff --git a/SdkImageCreator/src/org/tizen/installmanager/lib/Registry.java b/SdkImageCreator/src/org/tizen/installmanager/lib/Registry.java
deleted file mode 100644 (file)
index c9f1902..0000000
+++ /dev/null
@@ -1,268 +0,0 @@
-/*
- *  InstallManager
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: 
- * Wooyoung Cho <wooyoung1.cho@samsung.com>
- * Shihyun Kim <shihyun.kim@samsung.com>
- * Taeyoung Son <taeyoung2.son@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.lib;
-
-import java.io.BufferedReader;
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.InputStreamReader;
-
-import org.tizen.installmanager.core.Config;
-import org.tizen.installmanager.core.IMFatalException;
-import org.tizen.installmanager.lib.ErrorController.ErrorCode;
-import org.tizen.installmanager.util.PathUtil;
-
-/**
- * Manages target path to the registry file.
- * 
- * @author Shihyun Kim <shihyun.kim@samsung.com>
- * 
- */
-public class Registry {
-       //installed path.
-       private static final String REGISTRY_FILE_NAME = "tizensdkpath";
-       private static final String REGISTRY_FILE_PATH = PathUtil.get(
-                       Config.CONFIG_HOME, REGISTRY_FILE_NAME);
-       private static final String INSTALLED_PATH_KEY = "TIZEN_SDK_INSTALLED_PATH";
-
-       //installed version
-       private static final String INSTALLED_VERSION_FILE_NAME = "version";
-       private static final String INSTALLED_VERSION_FILE_PATH = PathUtil.get(
-                       Config.CONFIG_HOME, INSTALLED_VERSION_FILE_NAME);
-       private static final String INSTALLED_VERSION_KEY = "INSTALLED_VERSION";
-       
-       //registry information seperator
-       private static final String REGISTRY_SEPERATOR = "=";
-
-       /**
-        * Exports target path to the registry file.
-        * 
-        * @param targetPath
-        */
-       public static void exportInstallPath(String targetPath) {
-               if (targetPath == null || targetPath.isEmpty()) {
-                       Log.err("Install path is invalid: " + targetPath
-                                       + ". This might be a bug of IM");
-                       throw new IMFatalException(ErrorCode.INVALID_INSTALL_PATH);
-               }
-
-               String parameter = INSTALLED_PATH_KEY + REGISTRY_SEPERATOR + targetPath;
-
-               File installedPathFile = null;
-               try {
-                       installedPathFile = PathUtil.makeNewFile(REGISTRY_FILE_PATH);
-               } catch (IOException e) {
-                       Log.ExceptionLog(e);
-                       return;
-               }
-               
-               if (installedPathFile == null) {
-                       return;
-               }
-
-               BufferedWriter bw = null;
-               try {
-                       FileWriter fw = new FileWriter(installedPathFile);
-                       bw = new BufferedWriter(fw);
-                       bw.write(parameter);
-                       bw.flush();
-
-               } catch (Exception e) {
-                       Log.err("Cannot register to file. " + installedPathFile.getAbsolutePath());
-                       throw new IMFatalException(ErrorCode.CANNOT_REGISTER_TARGET_DIR);
-
-               } finally {
-                       if (bw != null) {
-                               try {
-                                       bw.close();
-
-                               } catch (IOException e) {
-                                       Log.ExceptionLog(e);
-                               }
-                       }
-               }
-       }
-
-       /**
-        * @return path in which SDK is installed. empty string if not found.
-        */
-       public static String getInstalledPath() {
-               return getPathFromRegistryKey(REGISTRY_FILE_PATH, INSTALLED_PATH_KEY);
-       }
-
-       private static String getPathFromRegistryKey(String path, String registryKey) {
-               File file = new File(path);
-
-               if (!file.exists()) {
-                       return "";
-               }
-
-               FileInputStream fis = null;
-               InputStreamReader isr = null;
-               BufferedReader br = null;
-
-               String readLine;
-               String result = "";
-               try {
-                       fis = new FileInputStream(file);
-                       isr = new InputStreamReader(fis);
-                       br = new BufferedReader(isr);
-
-                       while ((readLine = br.readLine()) != null) {
-                               if (readLine.startsWith(registryKey)) {
-                                       int startChar = readLine.indexOf("=");
-                                       if (startChar == -1) {
-                                               Log.err("OldRegistry.getPathFromRegistryKey() Invalid registry file => "
-                                                               + path + ", " + registryKey);
-                                               throw new IMFatalException("Invalid registry file");
-                                       }
-                                       result = readLine.substring(startChar + 1);
-                               }
-                       }
-
-                       return result;
-               } catch (IOException ioe) {
-                       Log.err("OldRegistry.getPathFromRegistryKey() Cannot read install path from .tizensdk file => "
-                                       + path + ", " + registryKey);
-                       throw new IMFatalException(
-                                       "Cannot read install path from .tizensdk file");
-               } finally {
-            if (br != null) {
-                try {
-                       br.close();
-                               } catch (IOException e) {
-                                       Log.ExceptionLog(e);
-                               }               
-            }
-            
-            if (isr != null) {
-                try {
-                                       isr.close();
-                               } catch (IOException e) {
-                                       Log.ExceptionLog(e);
-                               }               
-            }
-
-            if (fis != null) {
-                try {
-                       fis.close();
-                               } catch (IOException e) {
-                                       Log.ExceptionLog(e);
-                               }               
-            }
-        }
-       }
-
-       /**
-        * remove target path in the registry file.
-        */
-       public static void removeRegistry() {
-               File file = new File(REGISTRY_FILE_PATH);
-
-               if (file.exists()) {
-                       file.delete();
-               }
-               
-               removeOldFiles();
-       }
-       
-       /**
-        * Save installed version.
-        */
-       public static void saveInstallVersion(String version) {
-               File versionFile = null;
-               try {
-                       versionFile = PathUtil.makeNewFile(INSTALLED_VERSION_FILE_PATH);
-               } catch (IOException e) {
-                       Log.ExceptionLog(e);
-                       return;
-               }
-               
-               if (versionFile == null) {
-                       return;
-               }
-               
-               
-               BufferedWriter bw = null;
-               try {
-                       FileWriter fw = new FileWriter(versionFile);
-                       bw = new BufferedWriter(fw);
-                       
-                       String versionInformation = INSTALLED_VERSION_KEY + REGISTRY_SEPERATOR + version;
-                       bw.write(versionInformation);
-                       bw.flush();
-
-               } catch (Exception e) {
-                       Log.ExceptionLog(e);
-                       throw new IMFatalException(ErrorCode.CANNOT_REGISTER_TARGET_DIR);
-
-               } finally {
-                       if (bw != null) {
-                               try {
-                                       bw.close();
-
-                               } catch (IOException e) {
-                                       Log.ExceptionLog(e);
-                               }
-                       }
-               }
-       }
-       
-       /**
-        * Get installed version.
-        * @return
-        */
-       public static String getInstalledVersion() {
-               return getPathFromRegistryKey(INSTALLED_VERSION_FILE_PATH, INSTALLED_VERSION_KEY);
-       }
-       
-       public static boolean isInstallManagerInstalled() {
-               String installedPath = getInstalledPath();
-               
-               if (installedPath == null || installedPath.isEmpty()) {
-                       return false;
-               } else {
-                       return true;
-               }
-       }
-       
-       /**
-        * Temporary code to update.
-        */
-       private static void removeOldFiles() {
-               File file = new File(Config.OLD_CONFIG_HOME);
-               
-               if (file.exists()) {
-                       PathUtil.remove(file);
-               }
-       }
-}
diff --git a/SdkImageCreator/src/org/tizen/installmanager/lib/SDKPackageFormat.java b/SdkImageCreator/src/org/tizen/installmanager/lib/SDKPackageFormat.java
deleted file mode 100644 (file)
index e24abbd..0000000
+++ /dev/null
@@ -1,179 +0,0 @@
-/*
- *  InstallManager
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: 
- * Wooyoung Cho <wooyoung1.cho@samsung.com>
- * Shihyun Kim <shihyun.kim@samsung.com>
- * Taeyoung Son <taeyoung2.son@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.lib;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-
-import org.tizen.installmanager.core.IMFatalException;
-import org.tizen.installmanager.lib.ErrorController.ErrorCode;
-import org.tizen.installmanager.lib.linux.LinuxSDKPackageFormat;
-import org.tizen.installmanager.lib.win.WindowsSDKPackageFormat;
-import org.tizen.installmanager.util.PathUtil;
-
-/**
- * Manages to unpack package of tizen sdk.
- * 
- * @author Shihyun Kim <shihyun.kim@samsung.com>
- * 
- */
-public abstract class SDKPackageFormat {
-       protected FileOutputStream mFileOutput = null;
-       protected final String SDK_PACKAGE_ZIP_EXTENTION = ".zip";
-       protected final String SDK_PACKAGE_TAR_GZ_EXTENTION = ".gz";
-
-       public enum PackageType {
-               ELSE, ZIP, TAR_GZ
-       };
-
-       protected final static int ERROR = -1;
-       protected final static int SUCCESS = 1;
-
-       // abstract method
-       /**
-        * Unzip package.
-        * 
-        * @param fileFullPath
-        *            Absolute path of package file.
-        * @param targetDir
-        * @param monitor
-        * @return
-        */
-       protected abstract long unZip(File fileFullPath, File targetDir,
-                       IIMProgressMonitor monitor);
-
-       /**
-        * unzip SDK package to target directory
-        * 
-        * @param fileFullPath
-        * @param targetDir
-        * @param monitor
-        * @return
-        */
-       public long unZip(String fileFullPath, String targetDir,
-                       IIMProgressMonitor monitor) {
-               return unZip(new File(fileFullPath), new File(targetDir), monitor);
-       }
-
-       /**
-        * get package extension type
-        * 
-        * @param fileFullPath
-        * @return package extension
-        */
-       public PackageType getPackageType(String fileFullPath) {
-               String extention = PathUtil.getFileExtension(fileFullPath);
-
-               if (extention.equals(SDK_PACKAGE_ZIP_EXTENTION)) {
-                       return PackageType.ZIP;
-               } else if (extention.equals(SDK_PACKAGE_TAR_GZ_EXTENTION)) {
-                       return PackageType.TAR_GZ;
-               } else {
-                       return PackageType.ELSE;
-               }
-       }
-
-       /**
-        * set FileOutput instance It will be used to save installing file list.
-        * 
-        * @param installedListFilePath
-        *            file path that save installing file list.
-        */
-       public void setFileOutput(String installedListFilePath) {
-               setFileOutput(new File(installedListFilePath));
-       }
-
-       /**
-        * set FileOutput instance It will be used to save installing file list.
-        * 
-        * @param installedListFilePath
-        *            file path that save installing file list.
-        */
-       public void setFileOutput(File installedListFile) {
-               if (installedListFile == null) {
-                       return;
-               }
-
-               if (installedListFile.exists()) {
-                       installedListFile.delete();
-               }
-
-               File installedListDir = installedListFile.getParentFile();
-               if (!installedListDir.exists()) {
-                       installedListDir.mkdirs();
-               }
-
-               try {
-                       installedListFile.createNewFile();
-               } catch (IOException e) {
-                       throw new IMFatalException(ErrorCode.CANNOT_CREATE_INSTALL_LIST);
-               }
-
-               try {
-                       mFileOutput = new FileOutputStream(installedListFile);
-               } catch (FileNotFoundException e) {
-                       throw new IMFatalException(ErrorCode.CANNOT_CREATE_INSTALL_LIST);
-               }
-       }
-
-       /**
-        * Close FileOutput instance.
-        */
-       public void closeFileOutput() {
-               if (mFileOutput != null) {
-                       try {
-                               mFileOutput.close();
-                       } catch (IOException e) {
-                               Log.err("SDKPackageFormat fail to close output stream.");
-                       }
-                       mFileOutput = null;
-               }
-       }
-
-       /**
-        * Get SDKPackageFormat instance.
-        * 
-        * @return
-        */
-       public static SDKPackageFormat createSDKPackageFormat() {
-               if (Platform.CURRENT_PLATFORM == Platform.LINUX_32
-                               || Platform.CURRENT_PLATFORM == Platform.LINUX_64) {
-                       return new LinuxSDKPackageFormat();
-               } else if (Platform.CURRENT_PLATFORM == Platform.WINDOWS_32
-                               || Platform.CURRENT_PLATFORM == Platform.WINDOWS_64) {
-                       return new WindowsSDKPackageFormat();
-               } else if (Platform.CURRENT_PLATFORM == Platform.MACOS_64) {
-                       return new LinuxSDKPackageFormat();
-               } else {
-                       throw new IMFatalException(ErrorCode.UNSUPPORTED_PLATFORM);
-               }
-       }
-}
diff --git a/SdkImageCreator/src/org/tizen/installmanager/lib/ShellParser.java b/SdkImageCreator/src/org/tizen/installmanager/lib/ShellParser.java
deleted file mode 100644 (file)
index 8eade4e..0000000
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
-*  InstallManager
-*
-* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
-*
-* Contact: 
-* Wooyoung Cho <wooyoung1.cho@samsung.com>
-* Shihyun Kim <shihyun.kim@samsung.com>
-* Taeyoung Son <taeyoung2.son@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.lib;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-
-
-/**
- * Parsing standard out message and standard error message.
- * @author Shihyun Kim <shihyun.kim@samsung.com>
- *
- */
-public class ShellParser {
-       
-       protected StringBuilder mInputMessage = new StringBuilder();
-       protected StringBuilder mErrorMessage = new StringBuilder();
-       
-       private boolean mIsJoinable = true;
-       
-       public ShellParser() {
-               
-       }
-       
-       /**
-        * @param isJoinable If you set <code>true</code>, shell parsing with synchronization.
-        */
-       public ShellParser(boolean isJoinable) {
-               mIsJoinable = isJoinable;
-       }
-       
-       
-       /**
-        * Parsing standard out and error.
-        * @param process running process
-        */
-       public void runParsing(final Process process) {
-               
-               if (process == null) {
-                       return;
-               }
-               
-               Thread inputThread =  new Thread(){
-                       public void run() {
-                               parseStdOut(process.getInputStream());
-                       }
-               };
-               inputThread.start();
-               
-               Thread errorThread = new Thread() {
-                       public void run() {
-                               parseStdErr(process.getErrorStream());
-                       }
-               };
-               errorThread.start();
-               
-               try {
-                       if (mIsJoinable) {
-                               inputThread.join();
-                               errorThread.join();
-                       }
-               } catch (InterruptedException e) {
-                       Log.ExceptionLog(e);
-               }
-               
-       }
-
-       /**
-        * If you want to parse standard out stream, you must override this method
-        * @param input standard out stream
-        */
-       protected void parseStdOut(InputStream input) {
-               BufferedReader br = null;
-               try {
-            InputStreamReader isr = new InputStreamReader(input, Platform.CURRENT_CHARSET);
-            br = new BufferedReader(isr);
-            
-            String line;
-            while ( (line = br.readLine()) != null) {
-               mInputMessage.append(line.trim() + "\n");
-            }
-        } catch (IOException ioe) {
-                       Log.err("Shellparser fail to parse input stream.");
-        }finally{
-               if (br != null) {
-                               try {                                   
-                                       br.close();
-                               } catch (IOException e) {
-                                       Log.err("ShellParser fail to close output stream.");
-                               } 
-                       }
-        }
-       }
-       
-       /**
-        * If you want to parse standard error stream, you must override this method
-        * @param input standard error stream
-        */
-       protected void parseStdErr(InputStream input) {
-               BufferedReader br = null;
-               try {
-            InputStreamReader isr = new InputStreamReader(input, Platform.CURRENT_CHARSET);
-            br = new BufferedReader(isr);
-            
-            String line;
-            while ( (line = br.readLine()) != null) {
-               mErrorMessage.append(line.trim() + "\n");
-            }
-        } catch (IOException ioe) {
-               Log.ExceptionLog(ioe);
-        }finally{
-               if (br != null) {
-                               try {                                   
-                                       br.close();
-                               } catch (IOException e) {
-                                       Log.err("ShellParser fail to close output stream.");
-                               } 
-                       }
-        }
-       }
-       
-       /**
-        * Get standard out output
-        * @return stdout message.
-        */
-       public String getStdout() {
-               return mInputMessage.toString();
-       }
-       
-       /**
-        * Get standard error output
-        * @return stderr message.
-        */
-       public String getStdErr() {
-               return mErrorMessage.toString();
-       }
-}
diff --git a/SdkImageCreator/src/org/tizen/installmanager/lib/StartMenu.java b/SdkImageCreator/src/org/tizen/installmanager/lib/StartMenu.java
deleted file mode 100644 (file)
index 694ff30..0000000
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
-*  InstallManager
-*
-* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
-*
-* Contact: 
-* Wooyoung Cho <wooyoung1.cho@samsung.com>
-* Shihyun Kim <shihyun.kim@samsung.com>
-* Taeyoung Son <taeyoung2.son@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.lib;
-
-import java.io.File;
-import java.io.IOException;
-
-import org.tizen.installmanager.core.Config;
-import org.tizen.installmanager.core.IMFatalException;
-import org.tizen.installmanager.lib.ErrorController.ErrorCode;
-import org.tizen.installmanager.util.PathUtil;
-
-
-/**
- * This class manages program menu and shortcuts
- *
- * @author Shihyun Kim <shihyun.kim@samsung.com>
- */
-public class StartMenu {
-       
-       //linux shortcut
-       private static final String MENU_ICON = getMenuIcon();
-       private static final String INSTALLMANAGER_ICON = getInstallManagerIcon();
-       private static final String MENU_ICON_RESOURSE_PATH = "/res/desktop_directory/"+MENU_ICON;
-       private static final String INSTALLMANAGER_ICON_RESOURCE_PATH = "/res/desktop_directory/"+INSTALLMANAGER_ICON;
-       
-       private static String getMenuIcon() {
-               if (Platform.CURRENT_PLATFORM == Platform.LINUX_32
-                               || Platform.CURRENT_PLATFORM == Platform.LINUX_64) {
-                       return "tizen-sdk-menu.png";
-               } else if (Platform.CURRENT_PLATFORM == Platform.WINDOWS_32
-                               || Platform.CURRENT_PLATFORM == Platform.WINDOWS_64) {
-                       return "tizen-sdk-menu.ico";
-               } else if (Platform.CURRENT_PLATFORM == Platform.MACOS_64){
-                       return "";
-               } else {
-                       throw new IMFatalException(ErrorCode.UNSUPPORTED_PLATFORM);
-               }
-       }
-       
-       private static String getInstallManagerIcon() {
-               if (Platform.CURRENT_PLATFORM == Platform.LINUX_32
-                               || Platform.CURRENT_PLATFORM == Platform.LINUX_64) {
-                       return "tizen-sdk-installmanager.png";
-               } else if (Platform.CURRENT_PLATFORM == Platform.WINDOWS_32
-                               || Platform.CURRENT_PLATFORM == Platform.WINDOWS_64) {
-                       return "tizen-sdk-installmanager.ico";
-               } else if (Platform.CURRENT_PLATFORM == Platform.MACOS_64) {
-                       return "";
-               } else {
-                       throw new IMFatalException(ErrorCode.UNSUPPORTED_PLATFORM);
-               }
-       }
-       
-       /**
-        * Copy menu icon to target directory from resource.
-        */
-       public static void createDesktopIcon() {
-               Log.log("StartMenu.makeMenuIcon()");
-        
-               String iconPath = PathUtil.getFromInstalledPath(Config.INSTALL_MANAGER_DIRECTORY, StartMenu.MENU_ICON);
-       File targetIcon = new File(iconPath);
-        
-        try {
-                       PathUtil.copyFileFromResource(MENU_ICON_RESOURSE_PATH, targetIcon);
-               } catch (IOException e1) {
-                       Log.err("Cannot read resource '" + MENU_ICON_RESOURSE_PATH + "'");
-                       throw new IMFatalException(ErrorCode.CANNOT_CREATE_RESOURCE);
-               }
-       }
-       
-       /**
-        * Copy installmanager icon to target directory from resource.
-        */
-       public static void createInstallManagerIcon() {
-               Log.log("StartMenu.createProgramShortCutIconLinux()");
-               
-               String iconPath = PathUtil.getFromInstalledPath(Config.INSTALL_MANAGER_DIRECTORY, StartMenu.INSTALLMANAGER_ICON);
-       File targetIcon = new File(iconPath);
-       
-       try {
-                       PathUtil.copyFileFromResource(INSTALLMANAGER_ICON_RESOURCE_PATH , targetIcon);
-               } catch (IOException e) {
-                       Log.err("Create shortcut icon is failed.");
-                       Log.ExceptionLog(e);
-               }
-       }
-
-}
diff --git a/SdkImageCreator/src/org/tizen/installmanager/lib/linux/LinuxFileSystemInfo.java b/SdkImageCreator/src/org/tizen/installmanager/lib/linux/LinuxFileSystemInfo.java
deleted file mode 100644 (file)
index 440c04c..0000000
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
-*  InstallManager
-*
-* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
-*
-* Contact: 
-* Wooyoung Cho <wooyoung1.cho@samsung.com>
-* Shihyun Kim <shihyun.kim@samsung.com>
-* Taeyoung Son <taeyoung2.son@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.lib.linux;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.StringTokenizer;
-
-import org.tizen.installmanager.lib.IFileSystemInformation;
-import org.tizen.installmanager.lib.Log;
-
-
-/**
- * Provide information of linux file system.
- * 
- * @author Taeyoung Son <taeyoung2.son@samsung.com>
- *
- */
-public class LinuxFileSystemInfo implements IFileSystemInformation {
-
-       @Override
-       public List<File> getListMounts() {
-               List<File> mountList =  new ArrayList<File>();
-               BufferedReader reader = null;
-               InputStreamReader ipStream = null;
-               
-               try
-               { 
-                       Process p=Runtime.getRuntime().exec("df -k"); 
-                       p.waitFor(); 
-                       ipStream = new InputStreamReader(p.getInputStream());
-                       reader = new BufferedReader(ipStream); 
-                       
-                       String line = reader.readLine();
-                       String partition = "";
-                       List<String> deviceInfo= new ArrayList<String>();
-                       while(line!=null)
-                       {
-                               partition="";
-                               StringTokenizer tokens = new StringTokenizer(line, " ");
-                               int deviceNameColumn = tokens.countTokens();
-                               while(tokens.hasMoreTokens()){
-                                       deviceInfo.add(tokens.nextToken());
-                               }
-                               for (int i=5; i < deviceNameColumn;i++) {
-                                       partition += deviceInfo.get(i);
-                                       if(i!=(deviceNameColumn-1))
-                                               partition +=" ";
-                               }
-                               mountList.add(new File(partition));
-                               deviceInfo.clear();
-                               line=reader.readLine(); 
-                       }
-                       mountList.remove(0);
-
-               } catch(IOException e1) {
-                       Log.ExceptionLog(e1);
-               } catch(InterruptedException e2) {
-                       Log.ExceptionLog(e2);
-               } finally {
-                       if (ipStream != null) {
-                               try {
-                                       ipStream.close();
-                               } catch (IOException e) {
-                                       Log.ExceptionLog(e);
-                               }
-                       }
-                       
-                       if (reader != null) {
-                               try {
-                                       reader.close();
-                               } catch (IOException e) {
-                                       Log.ExceptionLog(e);
-                               }
-                       }
-               }
-
-               return mountList;
-       }
-
-       @Override
-       public File[] getListDevices() {
-               // TODO Auto-generated method stub
-               return null;
-       }
-
-       @Override
-       public FileSystemType getFileSystemType(File disk) {
-               // TODO Auto-generated method stub
-               return FileSystemType.UNKNOWN;
-       }
-
-}
diff --git a/SdkImageCreator/src/org/tizen/installmanager/lib/linux/LinuxProgramController.java b/SdkImageCreator/src/org/tizen/installmanager/lib/linux/LinuxProgramController.java
deleted file mode 100644 (file)
index 85a7cba..0000000
+++ /dev/null
@@ -1,192 +0,0 @@
-/*
-*  InstallManager
-*
-* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
-*
-* Contact: 
-* Wooyoung Cho <wooyoung1.cho@samsung.com>
-* Shihyun Kim <shihyun.kim@samsung.com>
-* Taeyoung Son <taeyoung2.son@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.lib.linux;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.tizen.installmanager.core.Config;
-import org.tizen.installmanager.lib.Log;
-import org.tizen.installmanager.lib.ProgramController;
-import org.tizen.installmanager.lib.Registry;
-import org.tizen.installmanager.lib.ShellParser;
-import org.tizen.installmanager.util.IMShellCommandFail;
-import org.tizen.installmanager.util.PathUtil;
-import org.tizen.installmanager.util.ShellUtil;
-
-
-/**
- * Manages linux process.
- * 
- * @author Shihyun Kim <shihyun.kim@samsung.com>
- *
- */
-public class LinuxProgramController extends ProgramController{
-       
-       public void terminateRunningProgram() {
-       List<Integer> list = getSDKPidList();
-       
-       if(list==null) {
-               return;
-       }
-       
-       for(int pid : list) {
-               String[] command = {"/bin/sh", "-c", "kill -9 " + pid};
-               try {
-                               ShellUtil.execute(command);
-                       } catch (IMShellCommandFail e) {
-                               Log.err("Failed to kill "+pid);
-                               // ignore kill failure
-                       }
-       }
-    }
-       
-       /**
-        * Check process whether or not pid is tizen sdk process.
-        * @param pid process id
-        * @return
-        */
-       private boolean isSDKProcess(int pid) {
-               Log.log("Check running process for sdk.");
-               if (checkCommandLine(pid) || checkExecutePath(pid)) {
-                       return true;
-               } else {
-                       return false;
-               }
-       }
-       
-       private boolean checkCommandLine(int pid) {
-               String pidCmd = "cat -A /proc/" + pid + "/cmdline";
-               
-               ShellParser parser = new ShellParser();
-               try {
-                       ShellUtil.execute(pidCmd, parser);
-               } catch (IMShellCommandFail e) {
-                       Log.ExceptionLog(e);
-                       // ignore
-                       return false;
-               }
-               
-               String output = parser.getStdout();
-
-               return isProcessRunningInInstalledPath(output);
-       }
-       
-       private boolean checkExecutePath(int pid) {
-               String pidCmd = "readlink -m /proc/" + pid + "/exe";
-               
-               ShellParser parser = new ShellParser();
-               try {
-                       ShellUtil.execute(pidCmd, parser);
-               } catch (IMShellCommandFail e) {
-                       Log.ExceptionLog(e);
-                       // ignore
-                       return false;
-               }
-               
-               String output = parser.getStdout();
-               return isProcessRunningInInstalledPath(output);
-       }
-       
-       public List<Integer> getSDKPidList() {
-               if (Registry.getInstalledPath().isEmpty()) {
-                       return null;
-               }
-               List<Integer> listSDKPIDs = new ArrayList<Integer>();
-
-               String[] command = {"/bin/sh", "-c", "ps -ax"};
-       LinuxShellRunningProgramParser parser = new LinuxShellRunningProgramParser();
-       try {
-                       ShellUtil.execute(command, parser);
-               } catch (IMShellCommandFail e1) {
-                       Log.log("Failed to get SDK pid's");
-                       return null; // ignore
-               }
-       
-       List<Integer> pidList = parser.getPIDList();
-       
-       for (int pid : pidList) {
-               if(isSDKProcess(pid)) {
-                       listSDKPIDs.add(pid);
-               }
-       }
-       
-       return listSDKPIDs;
-       }
-       
-       private boolean isProcessRunningInInstalledPath(String output) {
-               if (output.toString().indexOf(Registry.getInstalledPath()) >= 0) {
-                       if (!isInstallManager(output)) {
-                               Log.log("readlink exe for process => " + output);
-                               return true;
-                       }
-               }
-               
-               return false;
-       }
-       
-       /**
-        * @param path
-        * @return <code>true</code> if the path includes the install manager filename 
-        */
-       private boolean isInstallManager(String path) {
-               String fileName = PathUtil.getFileName(path);
-               
-               if (fileName.startsWith(Config.INSTALL_MANAGER_FILE_NAME) 
-                                     || fileName.equalsIgnoreCase(Config.INSTALL_MANAGER_BINARY)) {
-                       return true;
-               } else {
-                       return false;
-               }
-       }
-    
-    public boolean runningProgramExists() {
-       List<Integer> pidList = getSDKPidList();
-       
-       if (pidList == null || pidList.size() <= 0) {
-               return false;
-       }
-       
-       return true;
-    }
-    
-    public boolean removeSDKTempDir() {
-               Log.log("LinuxProgramController.removeSDKTempdir() start");
-               File tempDirFile = new File(PathUtil.getFromTempDir(Config.SDK_TEMP_DIR));
-               
-               if (tempDirFile.exists()) {
-                       PathUtil.remove(tempDirFile);
-               } else {
-                       Log.log("SDK temp directory doesn't exist => " + tempDirFile.getAbsolutePath());
-               }
-               
-               return true;
-    }
-}
diff --git a/SdkImageCreator/src/org/tizen/installmanager/lib/linux/LinuxSDKPackageFormat.java b/SdkImageCreator/src/org/tizen/installmanager/lib/linux/LinuxSDKPackageFormat.java
deleted file mode 100644 (file)
index 364225c..0000000
+++ /dev/null
@@ -1,189 +0,0 @@
-/*
-*  InstallManager
-*
-* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
-*
-* Contact: 
-* Wooyoung Cho <wooyoung1.cho@samsung.com>
-* Shihyun Kim <shihyun.kim@samsung.com>
-* Taeyoung Son <taeyoung2.son@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.lib.linux;
-
-import java.io.File;
-
-import org.tizen.installmanager.core.IMFatalException;
-import org.tizen.installmanager.lib.IIMProgressMonitor;
-import org.tizen.installmanager.lib.Log;
-import org.tizen.installmanager.lib.SDKPackageFormat;
-import org.tizen.installmanager.lib.ErrorController.ErrorCode;
-import org.tizen.installmanager.util.IMShellCommandFail;
-import org.tizen.installmanager.util.PathUtil;
-import org.tizen.installmanager.util.ShellUtil;
-
-
-/**
- * Manages to unpack package of tizen sdk for linux.
- * @author Shihyun Kim <shihyun.kim@samsung.com>
- *
- */
-public class LinuxSDKPackageFormat extends SDKPackageFormat{
-       private PackageType checkExtension;
-    
-    @Override
-    public long unZip(File fileFullPath, File targetDir, IIMProgressMonitor monitor) {
-        Log.log("Unpack "+fileFullPath+" to "+targetDir);
-        
-        checkExtension = getPackageType(fileFullPath.getAbsolutePath());
-        
-        if (!fileFullPath.exists()) {
-               Log.err("Package file is not exsisting");
-               return ERROR;
-        } else if (checkExtension == PackageType.ELSE) {
-               Log.err("Package extension is not '.zip' or '.tar.gz'");
-               return ERROR;
-        }
-        
-        if (targetDir == null || !targetDir.isAbsolute()) {
-               return ERROR;
-        }
-
-        if (!targetDir.exists()) {
-               targetDir.mkdirs();
-        }
-
-        int exitValue;
-        
-       try {
-               if (checkExtension == PackageType.ZIP) {
-                       exitValue = sendCommand( "unzip -ao "+ fileFullPath.getAbsolutePath() + " -d " + targetDir.getAbsolutePath(),
-                                       fileFullPath.getAbsolutePath(), PackageType.ZIP, monitor);
-                       unzipReturnValue(exitValue);
-               } else if (checkExtension == PackageType.TAR_GZ) {
-                       exitValue = sendCommand( "tar xvf "+ fileFullPath.getAbsolutePath() + " -C " + targetDir.getAbsolutePath(),
-                                       fileFullPath.getAbsolutePath(), PackageType.TAR_GZ, monitor);
-                       tarReturnValue(exitValue);
-               } else {
-                       throw new IMFatalException(ErrorCode.UNKNOWN_PACKAGE_EXTENSION);
-               }
-               } catch (IMShellCommandFail e) {
-                       return ERROR;
-               }
-
-        return SUCCESS;
-    }
-    
-    private int sendCommand(String command, String path, PackageType type, IIMProgressMonitor monitor) throws IMShellCommandFail {
-       LinuxShellInstalledListParser parser = null;
-       String fileName = PathUtil.getFileName(path);
-       
-       if (mFileOutput != null) {
-               parser = new LinuxShellInstalledListParser(fileName, type);
-               parser.setFileOutputStream(mFileOutput);
-               parser.setProgress(monitor);
-       }
-       
-       int exitValue = ShellUtil.execute(command, null, null, parser);
-       return exitValue;
-    }
-    
-    /**
-     * extract tar error case.
-     * @param exitValue
-     * @return
-     * @throws IMShellCommandFail
-     */
-       private static boolean tarReturnValue(int exitValue) throws IMShellCommandFail {
-               if (exitValue == 0) {
-                       return true;
-               } else {
-                       throw new IMShellCommandFail();
-               }
-       }
-    
-    /**
-     * extract zip error case.
-     * @param exitValue
-     * @return
-     * @throws IMShellCommandFail
-     */
-       private static boolean unzipReturnValue(int exitValue) throws IMShellCommandFail {
-               switch(exitValue) {
-               case 0:
-                       return true;
-               case 1:
-                       Log.err("one or more warning errors were encountered, but processing completed  successfully  anyway." +
-                                       "This  includes  zipfiles  where one or more files was skipped due to unsupported compression " +
-                                       "method or encryption with an unknown password.");
-                       throw new IMShellCommandFail();
-               case 2:
-                       Log.err("a generic error in the zipfile format was detected.  Processing may have completed" +
-                                       "successfully anyway; some broken zipfiles created by other archivers have simple work-arounds.");
-                       throw new IMShellCommandFail();
-               case 3:
-                       Log.err("a severe error in the zipfile format was detected.  Processing probably failed immediately.");
-                       throw new IMShellCommandFail();
-               case 4:
-                       Log.err("unzip was unable to allocate memory for one or more buffers during program initialization.");
-                       throw new IMShellCommandFail();
-               case 5:
-                       Log.err("unzip was unable to allocate memory or unable to obtain a tty to read the decryption password(s).");
-                       throw new IMShellCommandFail();
-               case 6:
-                       Log.err("unzip was unable to allocate memory during decompression to disk.");
-                       throw new IMShellCommandFail();
-               case 7:
-                       Log.err("unzip was unable to allocate memory during in-memory decompression.");
-                       throw new IMShellCommandFail();
-               case 8:
-                       Log.err("[currently not used]");
-                       throw new IMShellCommandFail();
-               case 9:
-                       Log.err("the specified zipfiles were not found.");
-                       throw new IMShellCommandFail();
-               case 10:
-                       Log.err("invalid options were specified on the command line.");
-                       throw new IMShellCommandFail();
-               case 11:
-                       Log.err("no matching files were found.");
-                       throw new IMShellCommandFail();
-               case 50:
-                       Log.err("the disk is (or was) full during extraction.");
-                       throw new IMShellCommandFail();
-               case 51:
-                       Log.err("the end of the ZIP archive was encountered prematurely.");
-                       throw new IMShellCommandFail();
-               case 80:
-                       Log.err("the user aborted unzip prematurely with control-C (or similar)");
-                       throw new IMShellCommandFail();
-               case 81:
-                       Log.err("testing or extraction of one or more files failed due to unsupported compression methods  or unsupported decryption.");
-                       throw new IMShellCommandFail();
-               case 82:
-                       Log.err("no  files  were  found due to bad decryption password(s).  (If even one file is successfully" +
-                     "processed, however, the exit status is 1.)");
-                       throw new IMShellCommandFail();
-               default:
-                       Log.err("Unknown exit value");
-                       throw new IMFatalException("Unknown exit value after unzip");
-               }
-       }
-}
diff --git a/SdkImageCreator/src/org/tizen/installmanager/lib/linux/LinuxShellInstalledListParser.java b/SdkImageCreator/src/org/tizen/installmanager/lib/linux/LinuxShellInstalledListParser.java
deleted file mode 100644 (file)
index bb436ca..0000000
+++ /dev/null
@@ -1,282 +0,0 @@
-/*
-*  InstallManager
-*
-* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
-*
-* Contact: 
-* Wooyoung Cho <wooyoung1.cho@samsung.com>
-* Shihyun Kim <shihyun.kim@samsung.com>
-* Taeyoung Son <taeyoung2.son@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.lib.linux;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-
-import org.tizen.installmanager.core.Config;
-import org.tizen.installmanager.core.IMFatalException;
-import org.tizen.installmanager.lib.IIMProgressMonitor;
-import org.tizen.installmanager.lib.Log;
-import org.tizen.installmanager.lib.Platform;
-import org.tizen.installmanager.lib.ShellParser;
-import org.tizen.installmanager.lib.ErrorController.ErrorCode;
-import org.tizen.installmanager.lib.SDKPackageFormat.PackageType;
-import org.tizen.installmanager.util.PathUtil;
-
-
-/**
- * Parsing standard out message and save installed file list.
- * @author Shihyun Kim <shihyun.kim@samsung.com>
- *
- */
-public class LinuxShellInstalledListParser extends ShellParser {
-       
-
-       IIMProgressMonitor mMonitor = null;
-       FileOutputStream mFileOut = null;
-       
-       final String FILE_PATH_SEPARATOR = ":";
-       private String fileName;
-       private PackageType extension;
-       
-       LinuxShellInstalledListParser(String name, PackageType type) {
-               fileName = name;
-               extension = type;
-       }
-
-       @Override
-       public void parseStdOut(InputStream input) {
-               // TODO Auto-generated method stub
-
-               BufferedReader br = null;
-               try {
-            InputStreamReader isr = new InputStreamReader(input, Platform.CURRENT_CHARSET);
-            br = new BufferedReader(isr);
-            
-            setMonitorFile();
-            
-            String line;
-            while ( (line = br.readLine()) != null) {
-                print(line);
-            }
-            
-            closeFileOutputStream();
-        } catch (IOException ioe) {
-               Log.err("Cannot parse shell input stream.");
-        }finally{
-               if (br != null) {
-                               try {                                   
-                                       br.close();
-                               } catch (IOException e) {
-                                       // TODO Auto-generated catch block
-                                       Log.err("LinuxShellInstalledListParser fail to close fileoutput");
-                               } 
-                       }
-        }
-       }
-       
-       private void setMonitorFile() {
-       if (mMonitor != null) {
-               mMonitor.setFileName(fileName);
-               mMonitor.workedFileName();
-       }               
-       }
-       
-       private void print(String line) {
-               printToProgressBar(line);
-       printToFile(line);
-    }
-    
-    private void printToProgressBar(String line) {     
-       if (mMonitor != null) {
-               String name = PathUtil.getFileName(line);
-               
-               mMonitor.setFileName(name);
-               mMonitor.workedFileName();
-       }
-    }
-    
-    private void printToFile(String line) {
-       if (mFileOut == null) {
-               return;
-       }
-       
-       String filePath = "";
-       if (extension == PackageType.ZIP) {
-               filePath = getFilePathFromValue(line);                  
-       } else if (extension == PackageType.TAR_GZ) {
-               filePath = PathUtil.getFromInstalledPath(Config.TEMP_DIRECTORY, line);
-       }
-
-       try {                   
-               String dataDir = PathUtil.getFromInstalledPath(Config.TEMP_DIRECTORY, Config.DATA_DIRECTORY); 
-               if (filePath.length() <= dataDir.length() || filePath.indexOf(dataDir) < 0) {
-                       return;
-               }
-               
-               int index = dataDir.length() + 1;
-
-               filePath = filePath.substring(index).trim();  
-               if (!filePath.equals("")) {
-                       filePath = filePath + "\n";
-                       mFileOut.write(filePath.getBytes());
-               }
-               } catch (IOException e) {
-                       // TODO Auto-generated catch block
-                       Log.err("File write failure(" + filePath + ")");
-                       Log.err(e.getMessage());
-                       throw new IMFatalException("File write failure(" + filePath + ")");
-               }
-    }
-    
-    private String getFilePathFromValue(String line) {
-       String value = getValue(line);
-       
-       if (value.length() <= 0) {
-               return "";
-       }
-       
-       String seperator = "";
-       if (isCreatingFile(line)) {
-               return value.trim();
-       } else if (isLinkingFile(line)) {
-               seperator = "->";
-       } else {
-               seperator = "[";
-       }
-       
-       int index = value.lastIndexOf(seperator);
-       
-       if (index < 0) {
-               return value.trim();
-       }
-       
-       return value.substring(0, index).trim();
-    }
-    
-    private String getKey(String line) {
-       int index = line.indexOf(FILE_PATH_SEPARATOR);
-       
-       if (index < 0 ){
-               return "";
-       }
-       
-       return line.substring(0, index).trim();
-    }
-    
-    private String getValue(String line) {     
-       int index = line.indexOf(FILE_PATH_SEPARATOR);
-       
-       if (index < 0 ){
-               return "";
-       }
-       
-       return line.substring(index+1).trim();
-    }
-    
-    /**
-     * set file output for saving installed list
-     * @param path
-     */
-    public void setFileOutputStream(String path) {
-       setFileOutputStream(new File(path));
-    }
-    
-    /**
-     * set file output for saving installed list
-     * @param filePath
-     */
-    public void setFileOutputStream(File filePath) {
-       File parentFile = filePath.getParentFile();
-       
-       if (!parentFile.exists()) {
-               parentFile.mkdirs();
-       }
-       
-       if (filePath.exists()) {
-               filePath.delete();
-       }
-       
-       
-               try {
-                       filePath.createNewFile();
-               } catch (IOException e) {
-                       Log.err("Cannot create install list => " + filePath.getAbsolutePath());
-                       throw new IMFatalException(ErrorCode.CANNOT_CREATE_INSTALL_LIST);
-               }
-       
-       try {
-                       mFileOut = new FileOutputStream(filePath);
-               } catch (FileNotFoundException e) {
-                       Log.err("Cannot create install list => " + filePath.getAbsolutePath());
-                       throw new IMFatalException(ErrorCode.CANNOT_CREATE_INSTALL_LIST);
-               }
-    }
-       
-    /**
-     * set file output for saving installed list
-     * @param fOut
-     */
-       public void setFileOutputStream(FileOutputStream fOut) {
-               mFileOut = fOut;
-       }
-       
-       /**
-        * close FileOutput instance.
-        */
-       public void closeFileOutputStream() {
-               if(mFileOut != null) {
-                       try {
-                               mFileOut.close();
-                               mFileOut = null;
-                       } catch (IOException e) {
-                               // TODO Auto-generated catch block
-                               Log.err("LinuxShellInstalledListParser fail to close fileoutput.");
-                       }
-               }
-       }
-       
-       /**
-        * If you set this, you can get file name to UI.
-        * @param monitor
-        */
-       public void setProgress(IIMProgressMonitor monitor) {
-               mMonitor = monitor;
-       }
-       
-       private boolean isLinkingFile(String line) {
-               String key = getKey(line);
-               
-               return key.equals("linking");
-       }
-       
-       private boolean isCreatingFile(String line) {
-               String key = getKey(line);
-               
-               return key.equals("creating");
-       }
-       
-}
diff --git a/SdkImageCreator/src/org/tizen/installmanager/lib/linux/LinuxShellRunningProgramParser.java b/SdkImageCreator/src/org/tizen/installmanager/lib/linux/LinuxShellRunningProgramParser.java
deleted file mode 100644 (file)
index 41486e4..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
-*  InstallManager
-*
-* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
-*
-* Contact: 
-* Wooyoung Cho <wooyoung1.cho@samsung.com>
-* Shihyun Kim <shihyun.kim@samsung.com>
-* Taeyoung Son <taeyoung2.son@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.lib.linux;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.tizen.installmanager.lib.Log;
-import org.tizen.installmanager.lib.Platform;
-import org.tizen.installmanager.lib.ShellParser;
-
-
-/**
- * Parsing standard out message and get pid.
- * @author Shihyun Kim <shihyun.kim@samsung.com>
- *
- */
-public class LinuxShellRunningProgramParser extends ShellParser{
-
-       List<Integer> mPIDList = new ArrayList<Integer>();
-       
-       @Override
-       public void parseStdOut(InputStream input) {
-               BufferedReader br = null;
-               try {
-            InputStreamReader isr = new InputStreamReader(input, Platform.CURRENT_CHARSET);
-            br = new BufferedReader(isr);
-            
-            String line;
-            while ( (line = br.readLine()) != null) {
-               try {
-                       int pid = Integer.parseInt(getPID(line));
-                       mPIDList.add(pid);
-               } catch(NumberFormatException e) {
-                       // ignore non-integer string
-               }
-            }
-        } catch (IOException ioe) {
-               Log.ExceptionLog(ioe);
-        }finally{
-               if (br != null) {
-                               try {                                   
-                                       br.close();
-                               } catch (IOException e) {
-                                       Log.err("LinuxShellRunningProgramParser fail to close output stream");
-                               } 
-                       }
-        }              
-       }
-       
-       private String getPID(String line) {
-               String[] info = line.split(" ");
-               int index = 0;
-               
-               while (info[index].equals("")) {
-                       ++index;
-               }
-               
-               return info[index];
-       }
-
-       /**
-        * Get pid list.
-        * @return
-        */
-       public List<Integer> getPIDList() {
-               return mPIDList;
-       }
-
-}
diff --git a/SdkImageCreator/src/org/tizen/installmanager/lib/mac/MacProgramController.java b/SdkImageCreator/src/org/tizen/installmanager/lib/mac/MacProgramController.java
deleted file mode 100644 (file)
index 3152379..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-package org.tizen.installmanager.lib.mac;
-
-import java.util.List;
-
-import org.tizen.installmanager.lib.ProgramController;
-
-public class MacProgramController extends ProgramController{
-
-       @Override
-       public void terminateRunningProgram() {
-               // TODO Auto-generated method stub
-               
-       }
-
-       @Override
-       public List<Integer> getSDKPidList() {
-               // TODO Auto-generated method stub
-               return null;
-       }
-
-       @Override
-       public boolean runningProgramExists() {
-               // TODO Auto-generated method stub
-               return false;
-       }
-
-       @Override
-       public boolean removeSDKTempDir() {
-               // TODO Auto-generated method stub
-               return false;
-       }
-
-}
diff --git a/SdkImageCreator/src/org/tizen/installmanager/lib/win/WindowsFileSystemInfo.java b/SdkImageCreator/src/org/tizen/installmanager/lib/win/WindowsFileSystemInfo.java
deleted file mode 100644 (file)
index 6ca72a4..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
-*  InstallManager
-*
-* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
-*
-* Contact: 
-* Wooyoung Cho <wooyoung1.cho@samsung.com>
-* Shihyun Kim <shihyun.kim@samsung.com>
-* Taeyoung Son <taeyoung2.son@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.lib.win;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.tizen.installmanager.lib.IFileSystemInformation;
-
-
-/**
- * Provide information of windows file system.
- * 
- * @author Taeyoung Son <taeyoung2.son@samsung.com>
- *
- */
-public class WindowsFileSystemInfo implements IFileSystemInformation {
-
-       @Override
-       public List<File> getListMounts() {
-               List<File> mountList =  new ArrayList<File>();
-               File[] roots = File.listRoots();
-               if(roots==null)
-                       return null;
-               
-               for(int i=0;i<roots.length;i++) {
-                       mountList.add(roots[i]);
-               }
-               return mountList;
-       }
-
-       @Override
-       public File[] getListDevices() {
-               // TODO Auto-generated method stub
-               return null;
-       }
-
-       @Override
-       public FileSystemType getFileSystemType(File disk) {
-               
-               // TODO Auto-generated method stub
-               return FileSystemType.UNKNOWN;
-       }
-
-}
\ No newline at end of file
diff --git a/SdkImageCreator/src/org/tizen/installmanager/lib/win/WindowsProgramController.java b/SdkImageCreator/src/org/tizen/installmanager/lib/win/WindowsProgramController.java
deleted file mode 100644 (file)
index 406ade7..0000000
+++ /dev/null
@@ -1,221 +0,0 @@
-/*
-*  InstallManager
-*
-* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
-*
-* Contact: 
-* Wooyoung Cho <wooyoung1.cho@samsung.com>
-* Shihyun Kim <shihyun.kim@samsung.com>
-* Taeyoung Son <taeyoung2.son@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.lib.win;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.List;
-
-import org.tizen.installmanager.core.Config;
-import org.tizen.installmanager.lib.Log;
-import org.tizen.installmanager.lib.ProgramController;
-import org.tizen.installmanager.lib.ShellParser;
-import org.tizen.installmanager.util.IMShellCommandFail;
-import org.tizen.installmanager.util.PathUtil;
-import org.tizen.installmanager.util.ShellUtil;
-
-
-/**
- * Manages windows process.
- * 
- * @author Shihyun Kim <shihyun.kim@samsung.com>
- *
- */
-public class WindowsProgramController extends ProgramController{
-
-       private final String VBSCRIPT_OF_CHECKING_RUNNING_PROGRAM =  "/res/desktop_directory/checkRunningTaskList.vbs";
-       private final String VBSCRIPT_NAME_OF_CHECKING_RUNNING_PROGRAM = "checkRunningTaskList";
-       private final String VBSCRIPT_EXTENTION_OF_CHECKING_RUNNING_PROGRAM = ".vbs";
-       
-
-       @Override
-       public void terminateRunningProgram() {
-               List<Integer> pidList = getSDKPidList();
-               
-               for (Integer pid : pidList) {
-                       String command = "TASKKILL /F /PID " + pid;
-                       try {
-                               ShellUtil.execute(command);
-                       } catch (IMShellCommandFail e) {
-                               Log.err("Failed to kill "+pid);
-                               // ignore kill failure
-                       }
-               }
-               
-               findAndKillEmulatorManagerProcess();
-               findAndKillWebSimulator();
-       }
-
-       @Override
-       public List<Integer> getSDKPidList() {
-               File script;
-               try {
-                       script = PathUtil.getTempFileFromResource(VBSCRIPT_OF_CHECKING_RUNNING_PROGRAM
-                               , VBSCRIPT_NAME_OF_CHECKING_RUNNING_PROGRAM
-                               , VBSCRIPT_EXTENTION_OF_CHECKING_RUNNING_PROGRAM);
-               } catch (IOException e) {
-                       Log.err("Failed to crate temp file from resource");
-                       Log.ExceptionLog(e);
-                       return null;
-               }
-
-               String command = "cscript " + script.getAbsolutePath();
-               WindowsShellRunningProgramParser parser = new WindowsShellRunningProgramParser();
-               
-               try {
-                       ShellUtil.execute(command, null, null, parser);
-               } catch (IMShellCommandFail e) {
-                       Log.err("Failed to get SDK pid's");
-                       Log.ExceptionLog(e);
-                       return null; // ignore
-               }
-               
-               return parser.getSDKPid();
-       }
-
-       @Override
-       public boolean runningProgramExists() {
-               List<Integer> pidList = getSDKPidList();
-               
-               if (pidList.size() > 0) {
-                       return true;
-               } else {
-                       return false;
-               }
-       }
-       
-       @Override
-       public boolean removeSDKTempDir() {
-               Log.log("WindowsProgramController.removeSDKTempDir() start");
-               
-               String tempDir = PathUtil.getFromTempDir(Config.SDK_TEMP_DIR);
-               return WindowsProgramController.removeRunningDir(tempDir);
-       }
-       
-       /**
-        * Remove running directory in Windows.
-        * This function execute remove script and remove script process wait for running process to finish.
-        * If you use System.exit(), All of process that created from your process are killed. 
-        * So this function do not work at this point of time.
-        * @param targetDir directory to remove.
-        * @return <code>true</code>if success
-        */
-       public static boolean removeRunningDir(String targetDir) {
-//             Log.log("WindowsProgramController.removeRunningDir() start");
-//             
-//             File targetFile = new File(targetDir);
-//             if (!targetFile.exists()) {
-//                     Log.log("Target directory does not exist => " + targetDir);
-//                     return true;
-//             }
-//             
-//             try {                                           
-//                     File removeScriptFile = PathUtil.getTempFileFromResource("/res/installmanager/removetizentemp.bat", "removetizentemp", ".bat", false);
-//                     
-//                     Map<String, String> env = setRemoveDirEnvironment(targetDir, removeScriptFile.getAbsolutePath());
-//                     
-//                     Process proc = ShellUtil.asyncExecute(removeScriptFile.getAbsolutePath()
-//                                                   , env
-//                                                   , new File(PathUtil.getTempDir())
-//                                                   , new ShellParser(false));
-//                     
-//                     if (proc != null) {
-//                             return true;
-//                     } else {
-//                             return false;
-//                     }
-//             } catch (IOException e) {
-//                     Log.err("removetizentemp.bat file doesn't exist");
-//                     return false;
-//             }
-               return true;
-       }
-       
-//     private static Map<String, String> setRemoveDirEnvironment(String targetDir, String removeScript) {
-//             Map<String, String> env = new HashMap<String, String>();
-//     
-//     setEnvironmentVariable(env, "TARGET_DIR", targetDir);
-//     setEnvironmentVariable(env, "REMOVE_SCRIPT_PATH", removeScript);
-//     
-//     return env;
-//     }
-       
-       private void findAndKillEmulatorManagerProcess() {
-               ShellParser parser = new ShellParser();
-               try {
-                       ShellUtil.execute("tasklist /FI \"WINDOWTITLE eq Emulator Manager\" /FO csv /NH", parser);
-               } catch (IMShellCommandFail e) {
-                       Log.ExceptionLog(e);
-                       return;
-               }
-               
-               String pid = getPidFromOutput(parser.getStdout());
-               
-               String command = "TASKKILL /F /PID " + pid;
-               try {
-                       ShellUtil.execute(command);
-               } catch (IMShellCommandFail e) {
-                       Log.err("Failed to kill "+pid);
-                       // ignore kill failure
-               }
-               
-       }
-       
-       private void findAndKillWebSimulator() {
-               ShellParser parser = new ShellParser();
-               try {
-                       ShellUtil.execute("tasklist /FI \"WINDOWTITLE eq Web Simulator\" /FO csv /NH", parser);
-               } catch (IMShellCommandFail e) {
-                       Log.ExceptionLog(e);
-                       return;
-               }
-               
-               String pid = getPidFromOutput(parser.getStdout());
-               
-               String command = "TASKKILL /F /PID " + pid;
-               try {
-                       ShellUtil.execute(command);
-               } catch (IMShellCommandFail e) {
-                       Log.err("Failed to kill "+pid);
-                       // ignore kill failure
-               }
-               
-       }
-       
-       private String getPidFromOutput(String output) {
-               String[] info = output.split(",");
-               
-               if (info.length < 2) {
-                       return "";
-               }
-               
-               return info[1];
-       }
-       
-}
diff --git a/SdkImageCreator/src/org/tizen/installmanager/lib/win/WindowsRegistry.java b/SdkImageCreator/src/org/tizen/installmanager/lib/win/WindowsRegistry.java
deleted file mode 100644 (file)
index c3be06e..0000000
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
-*  InstallManager
-*
-* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
-*
-* Contact: 
-* Wooyoung Cho <wooyoung1.cho@samsung.com>
-* Shihyun Kim <shihyun.kim@samsung.com>
-* Taeyoung Son <taeyoung2.son@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.lib.win;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.util.prefs.Preferences;
-
-import org.tizen.installmanager.lib.Platform;
-
-
-/**
- * Manage windows registry.
- * @author Shihyun Kim <shihyun.kim@samsung.com>
- *
- */
-public class WindowsRegistry {
-       
-       //Registry Key
-       public static final String REGISTRY_PATH_OF_SHELL_FOLDER = "HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders";
-       
-       //Shell Folder.name
-       public static final String REGISTRY_PROGRAMS_OF_SHELL_FOLDER = "Programs";
-       public static final String REGISTRY_LOCAL_APP_DATA_OF_SHELL_FOLDER = "\"Local AppData\"";
-       
-       //User key
-       public static final String TARGET_DIRECTORY_KEY = "tizensdk-installpath";
-       public static final String OLD_TARGET_DIRECTORY_KEY = "slpsdk-installpath";
-       
-       //Value Column
-       private static final String REG_SZ = "REG_SZ";
-       
-    /**
-     * Remove key and value in registry.
-     * @param key
-     */
-    public static void removeRegistry(String key) {
-        Preferences.userRoot().remove(key);
-    }
-    
-    /**
-     * Get value from node and key in registry.
-     * @param node path of registry
-     * @param key key of node.
-     * @return 
-     */
-    public static String getRegistryValue(String node, String key) {
-       if (!Platform.isWindows()) {
-               return null;
-       }
-               BufferedReader br = null;
-               String value = "";
-               
-               String query = "reg query " + "\"" + node + "\" /v " + key;
-               try {
-                       Process process = Runtime.getRuntime().exec(query);
-                       
-                       String encoding =  Platform.CURRENT_CHARSET;
-                       br = new BufferedReader(new InputStreamReader(process.getInputStream(), encoding));
-                       
-                       String line = null;
-                       while((line = br.readLine()) != null) {
-                               int index = line.indexOf(REG_SZ);
-                               if (index >= 0) {
-                                       value = line.substring(index + REG_SZ.length()).trim();
-                               }
-                       }
-               } catch (IOException e) {
-                       // TODO Auto-generated catch block
-                       e.printStackTrace();
-               } finally {
-                       if (br != null) {
-                               try {
-                                       br.close();
-                               } catch (IOException e) {
-                                       // TODO Auto-generated catch block
-                                       e.printStackTrace();
-                               }
-                       }
-               }
-               
-               return value;
-       }
-}
diff --git a/SdkImageCreator/src/org/tizen/installmanager/lib/win/WindowsSDKPackageFormat.java b/SdkImageCreator/src/org/tizen/installmanager/lib/win/WindowsSDKPackageFormat.java
deleted file mode 100644 (file)
index a686291..0000000
+++ /dev/null
@@ -1,254 +0,0 @@
-/*
-*  InstallManager
-*
-* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
-*
-* Contact: 
-* Wooyoung Cho <wooyoung1.cho@samsung.com>
-* Shihyun Kim <shihyun.kim@samsung.com>
-* Taeyoung Son <taeyoung2.son@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.lib.win;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipInputStream;
-
-import org.tizen.installmanager.core.IMFatalException;
-import org.tizen.installmanager.lib.IIMProgressMonitor;
-import org.tizen.installmanager.lib.Log;
-import org.tizen.installmanager.lib.SDKPackageFormat;
-import org.tizen.installmanager.lib.ErrorController.ErrorCode;
-import org.tizen.installmanager.util.PathUtil;
-
-
-/**
- * Manages to unpack package of tizen sdk for windows.
- * @author Shihyun Kim <shihyun.kim@samsung.com>
- *
- */
-public class WindowsSDKPackageFormat extends SDKPackageFormat{
-
-    final static int BUF_SIZE = 65536;
-    
-    private final String DATA_DIRECTORY = "data/";
-    
-    @Override 
-    public long unZip(File fileFullPath, File targetDir, IIMProgressMonitor monitor) {
-        Log.log("Unzip "+fileFullPath+" to "+targetDir);
-        
-        PackageType checkExtension = getPackageType(fileFullPath.getAbsolutePath());
-        
-        if (!fileFullPath.exists()) {
-               Log.err("Package file is not exsisting");
-               return ERROR;
-        } else if (checkExtension != PackageType.ZIP) {
-               Log.err("Package extension is not '.zip'");
-               return ERROR;
-        }
-               
-               if (targetDir == null || !targetDir.isAbsolute()) {
-                       return ERROR;
-               }
-               
-               if (!targetDir.exists()) {
-                       targetDir.mkdirs();
-               }
-
-               unZipPackage(fileFullPath, targetDir, monitor);
-        
-        closeFileOutput(); 
-        return SUCCESS;
-    }
-    
-       private long unZipPackage(File fileFullPath, File targetDir,
-               IIMProgressMonitor monitor) {
-               ZipInputStream zipInStream = null;
-               FileOutputStream zipOutput = null;
-               ZipEntry zipEntry = null;
-
-               try {
-                       // mFileOutput =
-                       // getFileListOutput(PathUtil.getFileNameWithOutExtension(fileFullPath));
-                       zipInStream = new ZipInputStream(new FileInputStream(fileFullPath));
-                       zipEntry = zipInStream.getNextEntry();
-
-                       long totalUnZipSize = 0;
-                       while (zipEntry != null) {
-
-                               if (monitor != null) {
-                                       String fileName = PathUtil.getFileName(zipEntry.getName());
-
-                                       monitor.setFileName(fileName);
-                                       monitor.workedFileName();
-                               }
-
-                               String targetPath = targetDir.getAbsolutePath()
-                                       + File.separator + zipEntry.getName();
-
-                               // make directory
-                               File targetFile = new File(targetPath);
-                               if (targetFile.exists() && targetFile.isDirectory()) {
-                                       writeFileList(zipEntry.getName());
-                                       zipEntry = zipInStream.getNextEntry();
-                                       continue;
-                               }
-
-                               File parentFile = targetFile.getParentFile();
-                               if (!parentFile.exists()) {
-                                       parentFile.mkdirs();
-                               }
-
-                               if (targetPath.endsWith("/")) {// zipEntry.isDirectory()) {
-                                       new File(targetPath).mkdir();
-                                       zipInStream.closeEntry();
-                                       writeFileList(zipEntry.getName());
-                                       zipEntry = zipInStream.getNextEntry();
-                                       continue;
-                               }
-
-                               zipOutput = new FileOutputStream(targetPath);
-
-                               byte[] zipBuf = new byte[BUF_SIZE];
-                               int readByte = 0;
-
-                               while ((readByte = zipInStream.read(zipBuf)) >= 0) {
-                                       zipOutput.write(zipBuf, 0, readByte);
-                                       zipOutput.flush();
-                                       totalUnZipSize += readByte;
-                               }
-
-                               writeFileList(zipEntry.getName());
-
-                               File outFile = new File(targetPath);
-                               if (outFile.isFile()
-                                       && (PathUtil.getFileExtension(outFile.getName())
-                                               .equals("") || PathUtil.getFileExtension(
-                                               outFile.getName()).equals("sh"))) {
-                                       outFile.setExecutable(true);
-                               }
-
-                               if (zipOutput != null) {
-                                       zipOutput.close();
-                               }
-
-                               if (zipEntry != null) {
-                                       zipInStream.closeEntry();
-                               }
-                               zipEntry = zipInStream.getNextEntry();
-                       }
-
-                       return totalUnZipSize;
-
-               } catch (IOException e) {
-                       if (zipEntry != null) {
-                               Log.err("Fail to unpack" + zipEntry.getName());
-                       }
-
-                       throw new IMFatalException(ErrorCode.CANNOT_UNPACK_PACKAGE);
-               } catch (Throwable e) {
-                       Log.ExceptionLog(e);
-                       throw new IMFatalException(e.getMessage());
-               } finally {
-                       try {
-                               if (zipOutput != null) {
-                                       zipOutput.close();
-                               }
-                       } catch (IOException e) {
-                               if (zipEntry != null) {
-                                       Log.err("Fail to close output stream : "
-                                               + zipEntry.getName());
-                               } else {
-                                       Log.ExceptionLog(e);
-                               }
-                       }
-
-                       try {
-                               if (zipInStream != null) {
-                                       zipInStream.closeEntry();
-                               }
-                       } catch (IOException e) {
-                               if (zipEntry != null) {
-                                       Log.err("Fail to close output stream : "
-                                               + zipEntry.getName());
-                               } else {
-                                       Log.ExceptionLog(e);
-                               }
-                       }
-                       
-                       if (zipInStream != null) {
-                               try {
-                                       zipInStream.close();
-                               } catch (IOException e) {
-                                       Log.ExceptionLog(e);
-                               }
-                       }
-
-                       try {
-                               if (mFileOutput != null) {
-                                       mFileOutput.close();
-                               }
-                       } catch (IOException e) {
-                               if (zipEntry != null) {
-                                       Log.err("Fail to close output stream : "
-                                               + zipEntry.getName());
-                               } else {
-                                       Log.ExceptionLog(e);
-                               }
-                       }
-
-                       closeFileOutput();
-               }
-       }
-    
-    private void writeFileList(String filePath) {
-       if (filePath == null || filePath.equals("")) {
-               return;
-       }
-       
-       filePath = removeDataDirectory(filePath);
-       if (filePath == null || filePath.equals("")) {
-               return;
-       }
-       try {
-                       mFileOutput.write((filePath + "\n").getBytes());
-               } catch (IOException e) {
-                       Log.err("Fail to unpack" + filePath);
-            throw new IMFatalException(ErrorCode.CANNOT_UNPACK_PACKAGE);
-               }
-    }
-    
-    private String removeDataDirectory(String filePath) {
-       if (filePath == null || filePath.equals("")) {
-               return "";
-       }
-       
-       if (!filePath.startsWith(DATA_DIRECTORY)) {
-               return "";
-       }
-       
-       filePath = filePath.substring(DATA_DIRECTORY.length());
-       return filePath;
-    }
-}
diff --git a/SdkImageCreator/src/org/tizen/installmanager/lib/win/WindowsShellRunningProgramParser.java b/SdkImageCreator/src/org/tizen/installmanager/lib/win/WindowsShellRunningProgramParser.java
deleted file mode 100644 (file)
index 901577a..0000000
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
-*  InstallManager
-*
-* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
-*
-* Contact: 
-* Wooyoung Cho <wooyoung1.cho@samsung.com>
-* Shihyun Kim <shihyun.kim@samsung.com>
-* Taeyoung Son <taeyoung2.son@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.lib.win;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.tizen.installmanager.core.Config;
-import org.tizen.installmanager.lib.Log;
-import org.tizen.installmanager.lib.Platform;
-import org.tizen.installmanager.lib.Registry;
-import org.tizen.installmanager.lib.ShellParser;
-
-
-/**
- * Parsing standard out message and get pid.
- * @author Shihyun Kim <shihyun.kim@samsung.com>
- *
- */
-public class WindowsShellRunningProgramParser extends ShellParser{
-       private List<Integer> mSDKProcessID = new ArrayList<Integer>();
-       
-       protected void parseStdOut(InputStream input) {
-               BufferedReader br = null;
-               try {
-            InputStreamReader isr = new InputStreamReader(input, Platform.CURRENT_CHARSET);
-            br = new BufferedReader(isr);
-            
-            String line;
-            while ( (line = br.readLine()) != null) {
-               setSDKPid(line);
-            }
-        } catch (IOException e) {
-               Log.ExceptionLog(e);
-        } finally{
-               if (br != null) {
-                               try {                                   
-                                       br.close();
-                               } catch (IOException e) {
-                                       Log.err("WindowsShellRunningProgramParser fail to close output stream");
-                                       Log.ExceptionLog(e);
-                               } 
-                       }
-        }      
-       }
-       
-       private void setSDKPid(String line) {
-               String[] infos = line.split(" ");
-               
-               if (infos.length < 2) {
-                       return;
-               } else {
-                       File targetPathFile = new File(Registry.getInstalledPath());
-                       
-                       String executeFilePath = null;
-                       String targetPath = null;
-                       try {
-                               executeFilePath = new File(infos[1]).getCanonicalPath();
-                               targetPath = targetPathFile.getCanonicalPath();
-                       } catch (IOException e) {
-                               Log.err("Cannot get canonical paths: " + infos[1] +
-                                               ", " + Registry.getInstalledPath());
-                               Log.ExceptionLog(e);
-                               return;
-                       }
-                       
-                       if ( executeFilePath.startsWith(targetPath) && 
-                                       !executeFilePath.contains(Config.INSTALL_MANAGER_DIRECTORY)) {
-                               Log.log("running non-IM found: "+executeFilePath);
-                               try {
-                                       int pid = Integer.parseInt(infos[0]);
-                                       mSDKProcessID.add(pid);
-                               } catch(NumberFormatException e) {
-                                       Log.ExceptionLog(e);
-                               }
-                       } else {
-                               return;
-                       }
-               }
-       }
-       
-       /**
-        * Get pid list
-        * @return
-        */
-       public List<Integer> getSDKPid() {
-               return mSDKProcessID;
-       }
-}
diff --git a/SdkImageCreator/src/org/tizen/installmanager/pkg/lib/PackageManager.java b/SdkImageCreator/src/org/tizen/installmanager/pkg/lib/PackageManager.java
deleted file mode 100644 (file)
index 93ff623..0000000
+++ /dev/null
@@ -1,1488 +0,0 @@
-/*
-*  InstallManager
-*
-* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
-*
-* Contact: 
-* Wooyoung Cho <wooyoung1.cho@samsung.com>
-* Shihyun Kim <shihyun.kim@samsung.com>
-* Taeyoung Son <taeyoung2.son@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.pkg.lib;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Stack;
-
-import org.tizen.installmanager.core.Config;
-import org.tizen.installmanager.core.DistributionController;
-import org.tizen.installmanager.core.IMExitException;
-import org.tizen.installmanager.core.IMFatalException;
-import org.tizen.installmanager.core.InstallManager;
-import org.tizen.installmanager.core.Options;
-import org.tizen.installmanager.lib.Downloader;
-import org.tizen.installmanager.lib.ErrorController;
-import org.tizen.installmanager.lib.Log;
-import org.tizen.installmanager.lib.ErrorController.ErrorCode;
-import org.tizen.installmanager.lib.Platform;
-import org.tizen.installmanager.pkg.lib.darwin.DarwinPackageManager;
-import org.tizen.installmanager.pkg.lib.linux.LinuxPackageManager;
-import org.tizen.installmanager.pkg.lib.win.WindowsPackageManager;
-import org.tizen.installmanager.pkg.model.IMPackageNotFound;
-import org.tizen.installmanager.pkg.model.Package;
-import org.tizen.installmanager.pkg.model.PackageSet;
-import org.tizen.installmanager.pkg.model.Properties;
-import org.tizen.installmanager.pkg.model.PropertySection;
-import org.tizen.installmanager.pkg.model.Snapshot;
-import org.tizen.installmanager.pkg.model.Version;
-import org.tizen.installmanager.util.PathUtil;
-
-
-/**
- * Package Manager
- * <p>
- * This class provides various methods for managing packages.
- * Most of the methods handle packages symbolically. Namely, they are identified by its package name not the object if not specially mentioned.
- * <p>
- * Some methods are carefully designed to preserve the order of packages because the order of packages is important sometimes. 
- * See the details in the documentation of each methods.
- * 
- * @author Shihyun Kim <shihyun.kim@samsung.com>
- *
- */
-public abstract class PackageManager {
-       /**
-        * Packages that are already installed in the system.
-        */
-       private PackageSet installedPackages;
-       /**
-        * packages that are available in the repositories(package servers).
-        */
-       private PackageSet repoPackages;
-       /**
-        * packages that combines <code>installedPackages</code> and <code>repoPackages</code>. 
-        * This includes only the latest package from the several versions of a package.
-        * This is used as the universe set(base set) of packages available.
-        */
-       private PackageSet recentPackages;
-       
-       /**
-        * Packages from extension package server.111
-        */
-       private PackageSet extensionPackages = new PackageSet();
-       
-       private static PackageManager pm = null;
-       
-       private enum State {
-               INSTALL,
-               UNINSTALL;
-       }
-       
-       //abstract method
-       /**
-        * Get package list file name.
-        * @return
-        */
-       abstract public String getPackageListFileName();
-       
-       /**
-        * Creates and initializes Package Manager instance.
-        * This combines installed packages and packages from the repositories.
-        * 
-        * @param installed a file in which installed packages are specified. This can be <code>null</code> if no packages are installed.
-        * @param repoPackagesUrls a collection of URLs of repositories(package servers). This cannot be <code>null</code>.
-        * @throws IOException if temporary file cannot created
-        */
-       protected PackageManager(File installed, Collection<String> repoPackagesUrls) throws IOException {
-               setInstalledPackageList(installed);
-               loadRepositoryPackageList(repoPackagesUrls);
-               getRecentPackages();
-       }
-       
-       /**
-        * Initializes package manager with information of installed packages and packages of repository
-        * @param sectionsInstalled a list of property sections of the installed packages
-        * @param repoToSectionsMap a map from base url of repository to a list of property sections of the repository
-        */
-       protected PackageManager(List<PropertySection> sectionsInstalled, Map<String,List<PropertySection>> repoToSectionsMap) {
-               setInstalledPackageList(sectionsInstalled);
-               setRepoPackages(repoToSectionsMap);
-               getRecentPackages();
-       }
-       
-       /**
-        * set repository url to each package.(reposistory url plus package name is complete url.)
-        * @param repoPackagesUrls
-        * @throws IOException
-        */
-       public void loadRepositoryPackageList(Collection<String> repoPackagesUrls) throws IOException {
-               HashMap<String,List<PropertySection>> r2sMap = null;
-               if (Config.fromWhere == Config.ConfDialog.LOCAL_IMAGE) { // Using SDK Image
-                       r2sMap = getRepositoryAndPackageList(repoPackagesUrls, false);
-               } else {
-                       r2sMap = getRepositoryAndPackageList(repoPackagesUrls, true);                   
-               }
-
-               setRepoPackages(r2sMap);
-       }
-       
-       /**
-        * set repository url to each package.(reposistory url plus package name is complete url.)
-        * @param repoPackagesUrls Packgae server list.
-        * @throws IOException
-        */
-       public void loadExtensionPackages(Collection<String> repoPackagesUrls) throws IOException {
-               HashMap<String,List<PropertySection>> repoToSectionsMap = getRepositoryAndPackageList(repoPackagesUrls, false);
-               setExtensionPackages(repoToSectionsMap);
-               setExtensionPackagesToRecentPackages();
-       }
-       
-       private HashMap<String,List<PropertySection>> getRepositoryAndPackageList
-               (Collection<String> repoPackagesUrls, boolean isSnapshotServer) throws IOException {
-               PropertyParser parser = new PropertyParser();
-               HashMap<String,List<PropertySection>> r2sMap = new HashMap<String,List<PropertySection>>();
-               
-               if(repoPackagesUrls != null) {
-                       for(String repo : repoPackagesUrls) {                           
-                               URL packageListURL = getPackageListPath(repo, isSnapshotServer);
-                               
-                               File packageListFile = downloadPackageListFile(packageListURL);
-                               
-                               if(packageListFile != null) {
-                                       r2sMap.put(repo, parser.readFromFile(packageListFile));
-                               } else {
-                                       Log.err("Ignore invalid repository: "+repo);
-                               }
-                       }
-               } else {
-                       Log.log("Cannot find repository. This is local installer.");
-               }
-               
-               return r2sMap;
-       }
-       
-       private File downloadPackageListFile(URL packageListURL) throws IOException {
-               if (packageListURL == null) {
-                       return null;
-               }
-               Downloader dl = InstallManager.getDownloader();
-               File tmp = null;
-               
-               if (Options.onlyDownload) {
-                       tmp = new File(PathUtil.getFromCurrDir(getPackageListFileName()));
-               } else {
-                       tmp = File.createTempFile("Packages", ".list");
-                       tmp.deleteOnExit();
-               }
-               
-               long size = dl.download(packageListURL, tmp.getAbsolutePath(), null);
-               
-               if (size > 0) {
-                       return tmp;
-               } else {
-                       return null;
-               }
-       }
-       
-       private void setExtensionPackages(HashMap<String,List<PropertySection>> repoToSectionsMap) {
-               extensionPackages = new PackageSet();
-               setPackages(extensionPackages, repoToSectionsMap, true);
-       }
-       
-       /**
-        * Get packages from extension package server.
-        * @return set of packages
-        */
-       public PackageSet getExtensionPackages() {
-               return extensionPackages;
-       }
-       
-       public PackageSet getInstalledExtensionPackages() {
-               PackageSet extensionPackages = new PackageSet();
-               
-               for (Package pkg : extensionPackages) {
-                       if (pkg.isExtensionPackage()) {
-                               extensionPackages.add(pkg);
-                       }
-               }
-               
-               return extensionPackages;
-       }
-       
-       /**
-        * Set installed packages.
-        * @param installedPackageListPath
-        */
-       public void setInstalledPackageList(File installedPackageListPath) {
-               List<PropertySection> sectionsInstalled = null;
-               PropertyParser parser = new PropertyParser();
-               
-               if(installedPackageListPath != null) {
-                       sectionsInstalled = parser.readFromFile(installedPackageListPath);
-               } else {
-                       sectionsInstalled= new LinkedList<PropertySection>();
-               }
-               
-               setInstalledPackageList(sectionsInstalled);
-       }
-       
-       /**
-        * Set installed packages
-        * @param sections
-        */
-       private void setInstalledPackageList(List<PropertySection> sections) {
-               installedPackages = new PackageSet();
-               
-               for(PropertySection sect : sections) {
-                       installedPackages.add(new Package(sect.getProperties()));
-               }
-       }       
-       
-       /**
-        * Get package list file path from url.
-        * @param url
-        * @return Full url path
-        */
-       private URL getPackageListPath(String url, boolean isSnapshotServer) {
-               if (url == null || url.isEmpty()) {
-                       return null;
-               } else {
-                       String packageListURL = "";
-
-                       if (isSnapshotServer) {
-                               String snapshotPath = Config.getInstance().getSnapshotPath();
-                               
-                               if (snapshotPath == null || snapshotPath.isEmpty()) {
-                                       String distribution = Config.getInstance().getConfigFile().getDistribution();
-                                       
-                                       Snapshot latestSnapshot = DistributionController.getInstance().getLatestSnapshot(distribution);
-                                       if (latestSnapshot == null) {
-                                               return null;
-                                       } else {
-                                               snapshotPath = DistributionController.getInstance().getLatestSnapshot(distribution).getPath();
-                                       }
-                               } else {}
-                               
-                               packageListURL = PathUtil.addURLPath(url, 
-                                                   snapshotPath, 
-                                                   getPackageListFileName());
-                               
-                       } else {
-                               packageListURL = PathUtil.addURLPath(url, getPackageListFileName());
-                       }
-                       
-                       try {
-                               return new URL(packageListURL);
-                       } catch (MalformedURLException e) {
-                               Log.ExceptionLog(e);
-                               return null;
-                       }
-               }
-       }
-       
-       
-       
-       /**
-        * @return installed packages
-        */
-       public PackageSet getInstalledPackages() {
-               return (PackageSet) installedPackages.clone();
-       }
-       
-       /**
-        * Set packages of repository
-        * @param sections
-        */
-       protected void setRepoPackages( Map<String,List<PropertySection>> repoToSectionsMap) {
-               repoPackages = new PackageSet();
-               setPackages(repoPackages, repoToSectionsMap, false);
-       }
-       
-       /**
-        * Set packages to <code>destPackages</code>
-        * @param destPackages It is set of packages.
-        * @param repoToSectionsMap It is added to <code>destPackages</code>
-        */
-       private void setPackages(PackageSet destPackages, Map<String,List<PropertySection>> repoToSectionsMap, boolean isExtensionPackage) {
-               if (destPackages == null) {
-                       destPackages = new PackageSet();
-               }
-               
-               for(String repoBaseUrl : repoToSectionsMap.keySet()) {
-                       for(PropertySection sect : repoToSectionsMap.get(repoBaseUrl)) {
-                                       Package pkg = new Package(sect.getProperties(), repoBaseUrl);
-                                       
-                                       if (isExtensionPackage) {
-                                               if (pkg.getAttribute().equalsIgnoreCase("extra")) {
-                                                       pkg.setExtensionServer(repoBaseUrl);
-                                                       destPackages.add(pkg);
-                                               }
-                                       } else {
-                                               destPackages.add(pkg);                                          
-                                       }
-                       }
-               }
-       }
-       
-       /**
-        * @return packages of repository
-        */
-       public PackageSet getRepoPackages() {
-               return repoPackages;
-       }
-       
-       /**
-        * @return root meta packages of repository
-        */
-       public PackageSet getRootMetaPackagesOfRepository() {
-               return rootMeta(repoPackages);
-       }
-       
-       /**
-        * Get install meta packages from repository.
-        * @return
-        */
-       public PackageSet getInstallMetaPackagesOfRepository() {
-               return installMeta(repoPackages);
-       }
-       
-       /**
-        * Get root meta package from extension package server()
-        */
-       public PackageSet getRootMetaPackagesOfExtensionServer() {
-               return rootMeta(extensionPackages);
-       }
-       
-       /**
-        * @return recent packages. This includes the latest packages among all packages from currently 
-        *              installed packages and packages of repository if a package has several versions.
-        */
-       public PackageSet getRecentPackages() {
-               if(recentPackages == null) {
-                       recentPackages = new PackageSet();
-                       for(Package ip : installedPackages) {
-                               if(repoPackages != null && repoPackages.contains(ip)) {
-                                       Package rp = repoPackages.getPackage(ip);
-                                       if(ip.getVersion().compareTo(rp.getVersion()) > 0) {
-                                               recentPackages.add(ip);
-                                       } else {
-                                               recentPackages.add(rp);
-                                       }
-                               } else if (extensionPackages != null && extensionPackages.contains(ip)) {
-                                       Package ep = extensionPackages.getPackage(ip);
-                                       if(ip.getVersion().compareTo(ep.getVersion()) > 0) {
-                                               recentPackages.add(ip);
-                                       } else {
-                                               recentPackages.add(ep);
-                                       }
-                               } else {
-                                       recentPackages.add(ip);
-                               }
-                       }
-                       
-                       for(Package rp : repoPackages) {
-                               if(!recentPackages.contains(rp)) {
-                                       recentPackages.add(rp);
-                               }
-                       }
-               }
-               return recentPackages;
-       }
-       
-       private void setExtensionPackagesToRecentPackages() {
-               if (recentPackages == null) {
-                       recentPackages = new PackageSet();
-               }
-               
-               for(Package ip : installedPackages) {
-                       if (extensionPackages != null && extensionPackages.contains(ip)) {
-                               Package ep = extensionPackages.getPackage(ip);
-                               if(ip.getVersion().compareTo(ep.getVersion()) > 0) {
-                                       recentPackages.add(ip);
-                               } else {
-                                       recentPackages.add(ep);
-                               }
-                       } else {
-                               recentPackages.add(ip);
-                       }
-               }
-       }
-       
-       
-       
-       // Methods for update process
-       /**
-        * except package from installed package list. 
-        * @param pkg
-        * @return
-        */
-       public boolean exceptPackageFromInstalledPackages(Package pkg) {
-               return installedPackages.remove(pkg);
-       }
-       
-       /**
-        * Add package to installed package list.
-        * @param pkg
-        * @return
-        */
-       public boolean addPackageToInstalledPackages(Package pkg) {
-               installedPackages.remove(pkg);
-               return installedPackages.add(pkg);
-       }
-       
-       /**
-        * @return updatable packages among installed packages
-        */
-       public PackageSet getUpdatableInstalledPackages() {
-               PackageSet updatables = new PackageSet();
-               for(Package ip : installedPackages) {
-                       if(repoPackages.contains(ip)) {
-                               Package rp = repoPackages.getPackage(ip);
-                               if(rp.getVersion().compareTo(ip.getVersion()) != 0) {
-                                       updatables.add(ip);
-                               }
-                       }
-               }
-               return updatables;
-       }
-       
-       /**
-        * if pkg is updatable, return true. else return false.
-        * @param pkg
-        * @return
-        */
-       public boolean isUpdatable(Package pkg) {
-               PackageSet updatables = getUpdatableInstalledPackages();
-               
-               if (updatables.contains(pkg)) {
-                       return true;
-               } else {
-                       return false;
-               }
-       }
-       
-       /**
-        * If pkg is installed, return true. else return false
-        * @param pkg
-        * @return
-        */
-       public boolean isInstalledVersion(Package pkg) {
-               Package installedPackage = installedPackages.getPackage(pkg);
-               if (installedPackage == null) {
-                       return false;
-               } else {
-                       Version installedVersion = installedPackage.getVersion();
-                       if (installedVersion.compareTo(pkg.getVersion()) == 0) {
-                               return true;
-                       } else {
-                               return false;
-                       }                       
-               }
-       }
-       
-       /**
-        * @return meta packages among installed packages
-        */
-       public PackageSet getInstalledMetaPackages() {
-               return meta(installedPackages);
-       }
-       
-       /**
-        * @return meta packages among all recent packages
-        */
-       public PackageSet getAllMetaPackages() {
-               PackageSet allMeta = new PackageSet();
-               
-               PackageSet recentMeta = meta(recentPackages);
-               PackageSet extensionMeta = meta(extensionPackages);
-               
-               allMeta.addAll(recentMeta);
-               allMeta.addAll(extensionMeta);
-               
-               return allMeta;
-       }
-       
-       public PackageSet getLeafMetaPackages() {
-               PackageSet allMetas = meta(recentPackages);
-               
-               PackageSet leafMetas = new PackageSet();
-               for (Package meta : allMetas) {
-                       //if (depends size <= 0) is leaf
-                       if (meta.getDependentPackageNames().size() <= 0) {
-                               leafMetas.add(meta);
-                       } else {
-                               if (!isChildrenAllMeta(meta)) {
-                                       leafMetas.add(meta);
-                               }
-                       }
-               }
-               
-               return leafMetas;
-       }
-       
-       private boolean isChildrenAllMeta(Package pkg) {
-               Collection<String> depends = pkg.getDependentPackageNames();
-               
-               PackageSet dependPackages = null;
-               try {
-                       dependPackages = recentPackages.getPackagesByNames(depends);
-               } catch (IMPackageNotFound e) {
-                       Log.ExceptionLog(e);
-               }
-               
-               if (dependPackages == null) {
-                       return true;
-               } else {
-                       for (Package dPackage : dependPackages) {
-                               if (!dPackage.isMeta()) {
-                                       return false;
-                               }
-                       }
-                       return true;
-               }
-       }
-       
-       /**
-        * @return partner meta packages among all meta packages.
-        */
-       public PackageSet getPartnerMetaPackages() {
-               PackageSet allMetas = meta(recentPackages);
-               
-               PackageSet partnerMeta = new PackageSet();
-               for (Package meta : allMetas) {
-                       if (meta.isPartnerMeta()) {
-                               partnerMeta.add(meta);
-                       }
-               }
-               
-               return partnerMeta;
-       }
-       
-       /**
-        * @return public meta packages among all meta packages.
-        */
-       public PackageSet getPublicMetaPackages() {
-               PackageSet allMetas = meta(recentPackages);
-               
-               PackageSet publicMeta = new PackageSet();
-               for (Package meta : allMetas) {
-                       if (meta.isPublicMeta()) {
-                               publicMeta.add(meta);
-                       }
-               }
-               
-               return publicMeta;
-       }
-       
-       /**
-        * Get dependency packages of installable package.
-        * @param pkgs installable packages.
-        * @return
-        */
-       public PackageSet getDependsPackagesFromRepository(PackageSet pkgs) {
-               return dep(pkgs, State.INSTALL);
-       }
-       
-       /**
-        * @return meta packages that have no updates considering its dependents
-        */
-       public PackageSet getNotUpdatableMetaPackages() {
-               PackageSet noup = new PackageSet();
-               for(Package m : getAllMetaPackages()) {
-                       if(!isMetaUpdatable(m)) {
-                               noup.add(m);
-                       }
-               }
-               return noup;
-       }
-       
-       public PackageSet getNotInstallableAndNotUpdatablePackages() {
-               PackageSet notPkg = new PackageSet();
-               
-               for (Package m :getAllMetaPackages()) {
-                       if (isMetaRemovable(m) && !isMetaUpdatable(m)) {
-                               notPkg.add(m);
-                       }
-               }
-               
-               return notPkg;
-       }
-       
-       /**
-        * @return meta packages thar are updatable among installed packages
-        */
-       public PackageSet getUpdatableMetaPackages() {
-               PackageSet allMetas = getAllMetaPackages();
-               PackageSet notUpdatableMetas = getNotUpdatableMetaPackages(); 
-               return diff(allMetas, notUpdatableMetas);
-       }
-
-       /**
-        * @param selectedMetas
-        * @return packages that will be installed after update/install resulted from the selected meta packages
-        */     
-       public PackageSet getResultPackagesAfterUpdate(PackageSet selectedMetas) {
-               PackageSet deps = dep(selectedMetas, State.INSTALL);
-               PackageSet conflicts = conflict(selectedMetas);
-               PackageSet remainedFromConflicts = diff(installedPackages, conflicts);
-               return union(deps, remainedFromConflicts);
-       }
-       
-       /**
-        * Get updatable packages in update process except new packages.
-        * @param selectedMetas
-        * @return
-        */
-       public PackageSet getUpdatablepackagesInUpdate(PackageSet selectedMetas) {
-               PackageSet result = dep(selectedMetas, State.INSTALL);
-               PackageSet up = getUpdatableInstalledPackages();
-               return intersect(result, up);
-       }
-       
-       /**
-        * Get removable packages in snapshot process except new packages.
-        * @param selectedMetas
-        * @return
-        */
-       public PackageSet getRemovablePackagesInSnapshot(PackageSet selectedMetas) {
-               PackageSet result = dep(selectedMetas, State.UNINSTALL);
-               PackageSet pkgSet = getdifferentVersionFromInstalledPackages(result);
-               
-               return pkgSet;
-       }
-       
-       /**
-        * check version between sourcePackages and installedPackages, and return different version packages.
-        * @param pkgs 
-        * @return Different version packages among installed packages
-        */
-       public PackageSet getdifferentVersionFromInstalledPackages(PackageSet pkgs) {
-               PackageSet depPkgs = dep(pkgs, State.INSTALL);
-               PackageSet otherVersionPackages = new PackageSet();
-               for(Package ip : installedPackages) {
-                       if(depPkgs.contains(ip)) {
-                               Package rp = depPkgs.getPackage(ip);
-                               if(rp.getVersion().compareTo(ip.getVersion()) != 0) {
-                                       otherVersionPackages.add(ip);
-                               }
-                       }
-               }
-               
-               return otherVersionPackages;
-       }
-       
-       /**
-        * @param selectedMetas
-        * @return packages to newly install in update process by the selected meta packages
-        */
-       public PackageSet getInstallablePackages(PackageSet selectedMetas) {
-               PackageSet result = getResultPackagesAfterUpdate(selectedMetas);
-               PackageSet installablePkgs = diffPackageWithVersion(result, installedPackages);
-               return installablePkgs;
-       }
-       
-       /**
-        * @param selectedMetas
-        * @return packages to update in update process by the selected meta packages
-        */
-       public PackageSet getToUpdatePackagesInUpdate(PackageSet selectedMetas) {
-               PackageSet result = getResultPackagesAfterUpdate(selectedMetas);
-               PackageSet up = getUpdatableInstalledPackages();
-               return intersect(result, up);
-       }
-
-
-       /**
-        * @param selectedMetas
-        * @return packages to remove in update process by conflicts with the selected meta packages 
-        */
-       public PackageSet getConflictPackagesInUpdate(PackageSet selectedMetas) {
-               PackageSet conflicts = conflict(selectedMetas);
-               return intersect(conflicts, installedPackages);
-       }
-       
-       // Methods for remove process
-       
-       /**
-        * @return packages that can be removed
-        */
-       public PackageSet getRemovableMetaPackages() {
-               return getInstalledMetaPackages();
-       }
-       
-       public PackageSet getInstallableMetaPackagesInSnapshot() {
-               PackageSet repoMetas = meta(repoPackages);
-               
-               PackageSet installableMeta = new PackageSet();
-               for (Package metaPackage : repoMetas) {
-                       if (isMetaInstallable(metaPackage)) {
-                               installableMeta.add(metaPackage);
-                       }
-               }
-               
-               return installableMeta;
-       }
-       
-       /**
-        * @param selectedMetas
-        * @return packages to remove in remove process
-        */
-       public PackageSet getToRemovePackagesInRemove(PackageSet selectedMetas) {
-               /*
-               PackageSet dep = dep(selectedMetas);
-               PackageSet mayRemove = intersect(installedPackages, dep);
-               PackageSet remainMetas = diff(getInstalledMetaPackages(), selectedMetas);
-               PackageSet remainPackages = dep(remainMetas);
-               PackageSet toRemove = diff(mayRemove, remainPackages);
-               return reverseSet(toRemove);
-               */
-               PackageSet dep = dep(selectedMetas, State.UNINSTALL);
-               return reverseSet(dep);
-       }
-       
-       /**
-        * @param selectedMetas
-        * @return packages that will be remained after remove resulted from the selected meta packages
-        */
-       public PackageSet getResultPackagesAfterRemove(PackageSet selectedMetas) {
-               return diff(getInstalledMetaPackages(), selectedMetas);
-       }
-       
-       // set handling methods
-       
-       /**
-        * @param pset
-        * @return meta packages in the package set
-        */
-       private PackageSet meta(PackageSet pset) {
-               PackageSet metas = new PackageSet();
-               
-               if (pset == null) {
-                       return metas;
-               }
-               
-               for(Package p : pset) {
-                       if(p.isMeta()) {
-                               metas.add(p);
-                       }
-               }
-               return metas;
-       }
-       
-       /**
-        * @param pset
-        * @return meta packages in the package set
-        */
-       private PackageSet rootMeta(PackageSet pset) {
-               PackageSet metas = new PackageSet();
-               for(Package p : pset) {
-                       if(p.isRootMeta() || p.isPartnerMeta() || p.isExtraMeta() || p.isPublicMeta()) {
-                               metas.add(p);
-                       }
-               }
-               return metas;
-       }
-       
-       /**
-        * @param pset
-        * @return meta packages in the package set
-        */
-       private PackageSet installMeta(PackageSet pset) {
-               PackageSet metas = new PackageSet();
-               for(Package p : pset) {
-                       if(p.isInstallMeta()) {
-                               metas.add(p);
-                       }
-               }
-               return metas;
-       }
-       
-       /**
-        * Get dependency package list from p.
-        * @param p a package
-        * @return all the packages that the given package depends on directly or indirectly
-        */
-       private PackageSet dep(Package p, State state) {
-               // depth first traverse on dependency graph
-               PackageSet dep = new PackageSet();
-               Stack<Package> pkgStack = new Stack<Package>();
-               pkgStack.push(p);
-               while(!pkgStack.isEmpty()) {
-                       Package pkg = pkgStack.pop();
-                               
-                       if(!dep.contains(pkg)) {
-                               dep.add(pkg);
-                               PackageSet depPackageSet = new PackageSet();
-                               try {
-                                       if (state == State.INSTALL) {
-                                               if (repoPackages.contains(pkg)) {
-                                                       depPackageSet = repoPackages.getPackagesByNames(pkg.getDependentPackageNames());
-                                               } else if (extensionPackages.contains(pkg)) {
-                                                       depPackageSet = extensionPackages.getPackagesByNames(pkg.getDependentPackageNames());
-                                               }
-                                       } else if (state == State.UNINSTALL){
-                                               depPackageSet = installedPackages.getPackagesByNames(pkg.getDependentPackageNames());
-                                       } else {
-                                               Log.err("State class have two state(INSTALL/UNINSTALL) ");
-                                               throw new IMFatalException(ErrorCode.UNKOWN_ERROR); 
-                                       }
-                               } catch (IMPackageNotFound e) {
-                                       Log.err("Finding dependents: "+p+": Package does not exist: " + e.getPackageName()+ " or "+ pkg.getDependentPackageNames());
-                                       throw new IMFatalException(ErrorCode.CANNOT_FIND_PACKAGE);
-                               }
-
-                               for(Package depPkg : depPackageSet) {
-                                       if(p.equals(depPkg)) {
-                                               Log.err("Circular dependency found: "+p);
-                                               throw new IMFatalException(ErrorCode.CIRCULAR_PACKAGE_DEPENDENCY);
-                                       }
-                                       pkgStack.push(depPkg);
-                               }
-                       } else {
-                               // already visited.
-                               addDependsSet(dep, pkg);
-                       }
-               }
-               
-               return reverseSet(dep);
-       }
-       
-       /**
-        * Need reverse depends when remove.
-        * @param p
-        * @return
-        */
-       private PackageSet reverseDep(Package p) {
-               // depth first traverse on dependency graph
-               PackageSet reverseDep = new PackageSet();
-               Stack<Package> pkgStack = new Stack<Package>();
-               pkgStack.push(p);
-               while(!pkgStack.isEmpty()) {
-                       Package pkg = pkgStack.pop();
-                               
-                       if(!reverseDep.contains(pkg)) {
-                               reverseDep.add(pkg);
-                               
-                               for (Package recentPkg : recentPackages) {
-                                       Collection<String> dependsList = recentPkg.getDependentPackageNames();
-                                       for (String pkgName :  dependsList) {
-                                               if (pkgName.equals(pkg.getPackageName())) {
-                                                       pkgStack.push(recentPkg);
-                                                       break;
-                                               }
-                                       }
-                                       
-                               }
-                       } else {
-                               // already visited
-                               addDependsSet(reverseDep, pkg);
-                       }
-               }
-               
-               return reverseDep;
-       }
-       
-       /**
-        * Remove saved package and save package at the end of set.
-        * @param dependsSet
-        * @param pkg
-        */
-       private void addDependsSet(PackageSet dependsSet, Package pkg) {
-               if (dependsSet.contains(pkg)) {
-                       dependsSet.remove(pkg);
-               }
-               
-               dependsSet.add(pkg);
-       }
-       
-       /**
-        * reverse package list.
-        * @param pkgSet
-        * @return
-        */
-       public PackageSet reverseSet(PackageSet pkgSet) {
-               if (pkgSet == null) {
-                       return null;
-               }
-               
-               Stack<Package> stack = new Stack<Package>();
-               for (Package pkg : pkgSet) {
-                       stack.push(pkg);
-               }
-               
-               PackageSet reverseSet = new PackageSet();
-               
-               while(!stack.isEmpty()) {
-                       reverseSet.add(stack.pop());
-               }
-               
-               return reverseSet;
-       }
-       
-       /**
-        * @param pset package set
-        * @return all the packages that the given packages depends on directly or indirectly
-        */
-       private PackageSet dep(PackageSet pset, State state) {
-               PackageSet dep = new PackageSet();
-               for(Package p : pset) {
-                       dep.addAll(dep(p, state));
-               }
-               return dep;
-       }
-       
-       /**
-        * Get conflict package list from p.
-        * @param p
-        * @return packages that conflict with the given package directly or indirectly
-        */
-       public PackageSet conflict(Package p) {
-               PackageSet conflicts = new PackageSet();
-               PackageSet dep = dep(p, State.INSTALL);
-               for(Package pkg : dep) {
-                       Collection<String> conflictPackageNames = pkg.getConflictPackageNames();
-                       for(String conflictPackageName : conflictPackageNames) {
-                               if(installedPackages.hasPackageByName(conflictPackageName)) {
-                                       Package conflictPackage = installedPackages.getPackageByName(conflictPackageName);
-                                       conflicts.addAll(reverseDep(conflictPackage));
-                               }
-                       }
-               }
-               return conflicts;
-       }
-       
-       /**
-        * Get conflict package list.
-        * @param pset
-        * @return packages that conflict with the given packages directly or indirectly 
-        */
-       private PackageSet conflict(PackageSet pset) {
-               PackageSet conflicts = new PackageSet();
-               for(Package p : pset) {
-                       conflicts.addAll(conflict(p));
-               }
-               return conflicts;
-       }
-       
-       /**
-        * Adds packages of pset2 to packages of pset1.
-        * @param pset1
-        * @param pset2
-        * @return new package set has the union of pset1 and pset2.
-        */
-       private PackageSet union(PackageSet pset1, PackageSet pset2) {
-               PackageSet union = (PackageSet) pset1.clone();
-               union.addAll(pset2);
-               return union;
-       }
-       
-       /**
-        * Removes packages of pset2 from packages of pset1.
-        * @param pset1
-        * @param pset2
-        * @return new package set that represents (pset1 - pset2). 
-        */
-       private PackageSet diff(PackageSet pset1, PackageSet pset2) {
-               PackageSet diff = new PackageSet();
-               for(Package p : pset1) {
-                       if(!pset2.contains(p)) {
-                               diff.add(p);
-                       }
-               }
-               return diff;
-       }
-       
-       private PackageSet diffPackageWithVersion(PackageSet pset1, PackageSet pset2) {
-               PackageSet diff = new PackageSet();
-               for(Package p : pset1) {
-                       Package pkg = pset2.getPackage(p);
-                       
-                       if (pkg == null) {
-                               diff.add(p);
-                       } else {
-                               if (Version.compareTo(p.getVersion(), pkg.getVersion()) != 0) {
-                                       diff.add(p);
-                               }
-                       }
-               }
-               return diff;
-       }
-       
-       /**
-        * 
-        * @param pset1
-        * @param pset2
-        * @return new set of intersection of pset1 and pset2. It has the order of pset1.
-        */
-       private PackageSet intersect(PackageSet pset1, PackageSet pset2) {
-               PackageSet pset = new PackageSet();
-               for(Package p : pset1) {
-                       if(pset2.contains(p)) {
-                               pset.add(p);
-                       }
-               }
-               return pset;
-       }
-       
-       /**
-        * @param m meta package to be checked updatable
-        * @return <code>true</code> if the meta package is updatable. 
-        *              ie. the meta package is installed and one of its dependents is already installed and is updatable.
-        */
-       private boolean isMetaUpdatable(Package m) {            
-               // if one of the meta package's dependents is installed and updatable, the meta package is updatable.
-               PackageSet dep = dep(m, State.INSTALL);
-
-               for(Package p : dep) {
-                       
-                       if(installedPackages.contains(p)) {
-                               Package ip = installedPackages.getPackage(p);
-                               if (ip == null) {
-                                       continue;
-                               }
-                               
-                               Package rp = null;
-                               if (repoPackages != null && repoPackages.hasPackage(p)) {
-                                       rp = repoPackages.getPackage(p);
-                               } else if (extensionPackages != null && extensionPackages.hasPackage(p)) {
-                                       rp = extensionPackages.getPackage(p);
-                               }
-                               
-                               // checks p is updatable
-                               if(rp != null && rp.getVersion().compareTo(ip.getVersion()) != 0) {
-                                       return true;
-                               }
-                       }
-               }
-               return false;
-       }
-       
-
-       
-       /**
-        * @param m meta package to be checked removable
-        * @return <code>true</code> if the meta package is removable 
-        *              ie. the meta package is installed and one of its dependents is already installed and is removable.
-        */
-       private boolean isMetaRemovable(Package m) {
-               // if the meta package is not installed, it's never updatable
-               if(installedPackages.contains(m)) {
-                       return true;
-               } else {
-                       return false;
-               }
-       }
-       
-       /**
-        * check new installation or upgrade or downgrade.
-        * @param meta meta package to be checked installable.
-        * @return <code>true</code> if the meta package is updatable. 
-        *              ie. the meta package is installed and one of its dependents is already installed and is updatable.
-        */
-       private boolean isMetaInstallable(Package meta) {                               
-               // if one of the meta package's dependents is installed and updatable, the meta package is updatable.
-               PackageSet dep = dep(meta, State.INSTALL);
-               
-               for(Package p : dep) {
-                       //Do not check meta package. It is only used by install-type or category.
-                       if (p.isMeta()) {
-                               continue;
-                       }
-                       
-                       if(installedPackages.contains(p)) {
-                               Package ip = installedPackages.getPackage(p);
-                               if (ip == null) {
-                                       continue;
-                               }
-                               
-                               Package rp = repoPackages.getPackage(p); // rp always exists if ip exists
-                               
-                               // checks p is updatable
-                               if(rp.getVersion().compareTo(ip.getVersion()) != 0) {
-                                       return true;
-                               }
-                       } else {
-                               return true;
-                       }
-               }
-               return false;
-       }
-       
-       // utility methods
-       /**
-        * Get installed package.
-        * @param pkg
-        * @return If not exist package in installed package list, return empty string.
-        */
-       public Package getInstalledPackageByName(String pkgName) {
-               Package retPkg = installedPackages.getPackageByName(pkgName);
-               
-               return retPkg;
-       }
-       
-       /**
-        * Get installed packages by package name.
-        * @param pkgName name of packages
-        * @return If not exist package in installed package list, return empty string.
-        */
-       public PackageSet getInstalledPackagesByName(List<String> pkgNames) {
-               PackageSet installedPackages = new PackageSet();
-               for (String pkg : pkgNames) {
-                       Package retPkg = getInstalledPackageByName(pkg);
-                       
-                       if (retPkg != null) {
-                               installedPackages.add(retPkg);
-                       }
-               }
-               
-               return installedPackages;
-       }
-       
-       /**
-        * Get Package instance from package name.
-        * @param pkgName
-        * @return
-        */
-       public Package getPackageByName(String pkgName) {
-               if(repoPackages.hasPackageByName(pkgName)) {
-                       return repoPackages.getPackageByName(pkgName);
-               } else {
-                       return null;
-               }
-       }
-       /**
-        * @param packageNames
-        * @return packages collected by the given package names
-        */
-       public PackageSet getPackagesByNames(Collection<String> packageNames) {
-               PackageSet pset = new PackageSet();
-               for(String name : packageNames) {
-                       if(repoPackages.hasPackageByName(name)) {
-                               Package pkg = repoPackages.getPackageByName(name);
-                               pset.add(pkg);
-                       } else if (extensionPackages.hasPackageByName(name)) {
-                               Package pkg = extensionPackages.getPackageByName(name);
-                               pset.add(pkg);
-                       } else {
-                               throw new IMFatalException(ErrorCode.CANNOT_FIND_FILE_IN_REPOSITROY);
-                       }
-               }
-               return pset;
-       }
-       
-       public PackageSet getMandatoryPackages() {
-               PackageSet pSet = new PackageSet();
-               
-               for (Package pkg : repoPackages) {
-                       if (pkg.isMandatory()) {
-                               pSet.add(pkg);
-                       }
-               }
-               
-               return pSet;
-       }
-       
-       /**
-        * Check installed meta packages
-        * @return if installed package exists, return true. if not return false.
-        */
-       public boolean existInstalledMetaPackages() {
-               if (getInstalledMetaPackages().size() <= 0) {
-                       return false;
-               } else {
-                       return true;
-               }
-       }
-       
-       /**
-        * Check installable meta packages
-        * @return if installable meta package exists, return true. if not return false.
-        */
-       public boolean existInstallableMetaPackages() {
-               if (getInstalledMetaPackages().size() <= 0) {
-                       return false;
-               } else {
-                       return true;
-               }
-       }
-       
-       /**
-        * Check installed packages.
-        * @return if installed package exists, return true. if not return false.
-        */
-       public boolean existInstalledPackages() {
-               if (installedPackages.size() <= 0) {
-                       return false;
-               } else {
-                       return true;
-               }
-       }
-       
-       /**
-        * Check installable or updatable packages.
-        * @return if installable package exists, return true. if not return false.
-        */
-       public boolean existInstallablePackages() {
-               for(Package p : repoPackages) {
-                       if(installedPackages.contains(p)) {
-                               Package ip = installedPackages.getPackage(p);
-                               if (ip == null) {
-                                       continue;
-                               }
-                               
-                               Package rp = recentPackages.getPackage(p); // rp always exists if ip exists
-                               // checks p is updatable
-                               if(rp.getVersion().compareTo(ip.getVersion()) > 0) {
-                                       return true;
-                               }
-                       }
-               }
-               return false;
-       }
-       
-       
-       /**
-        * get total size to install. 
-        * @param pkg
-        * @return
-        */
-       public long getTotalSizeOfInstallablePackages(Package pkg) {
-               PackageSet pkgs = new PackageSet();
-               
-               pkgs.add(pkg);
-               PackageSet depPkgSet = getInstallablePackages(pkgs);
-               
-               return getTotalSize(depPkgSet);
-       }
-       
-       /**
-        * get total size to remove. 
-        * @param pkg
-        * @return
-        */
-       public long getTotalSizeOfRemovablePackages(Package pkg) {
-               PackageSet pkgs = new PackageSet();
-               
-               pkgs.add(pkg);
-               PackageSet depPkgSet = getToRemovePackagesInRemove(pkgs);
-               
-               return getTotalSize(depPkgSet);
-       }
-       
-       /**
-        * get total size to install. 
-        * @param pkg
-        * @return
-        */
-       public long getTotalSizeOfInstallablePackages(PackageSet pkgs) {
-               PackageSet depPkgSet = getInstallablePackages(pkgs);
-               
-               return getTotalSize(depPkgSet);
-       }
-       
-       /**
-        * get total size to remove. 
-        * @param pkg
-        * @return
-        */
-       public long getTotalSizeOfRemovablePackages(PackageSet pkgs) {
-               PackageSet depPkgSet = getRemovablePackagesInSnapshot(pkgs);
-               
-               return getTotalSize(depPkgSet);
-       }
-       
-       /**
-        * get total size to install
-        * @param pkgs
-        * @return
-        */
-//     public long getInstallablePackageSize(PackageSet pkgs) {                
-//             return getTotalSize(pkgs);
-//     }
-       
-       private long getTotalSize(PackageSet pkgs) {
-               long totalSize = 0;
-               for (Package depPkg : pkgs) {
-                       totalSize += depPkg.getPackageSize();
-               }
-               
-               return totalSize;
-       }
-       
-       /**
-        * @return <code>true</code> if installed and repository packages are empty.
-        */
-       public boolean isEmpty() {
-               
-               if (installedPackages.size() <= 0 && repoPackages.size() <= 0) {
-                       return true;
-               }
-               
-               return false;
-       }
-       
-       /**
-        * Get Installable packages.
-        * @return packages that can be newly installable.
-        */
-       public PackageSet getInstallableMetaPackages() {
-               return diff(getAllMetaPackages(), getInstalledMetaPackages());
-       }
-
-       /**
-        * @return packages that can be newly installable or updatable. 
-        */
-       public PackageSet getInstallableOrUpdatableMetaPackages() {
-               PackageSet installableMetaPackages = new PackageSet();
-               PackageSet allMetaPackages = getAllMetaPackages();
-               
-               for (Package metaPackage : allMetaPackages) {
-                       if (isMetaInstallable(metaPackage)) {
-                               installableMetaPackages.add(metaPackage);
-                       }
-               }
-               
-               return installableMetaPackages;
-       }
-       
-       
-       /**
-        * Check missing packages from repository's package list.   
-        * @return packages that is missing in repository's package list.
-        */
-       public PackageSet getMissingPackagesFromRepository() {
-               PackageSet missingPackages = new PackageSet();
-               
-               if (!repoPackages.isEmpty()) {
-                       missingPackages = diff(installedPackages, repoPackages);
-                       missingPackages = diff(missingPackages, extensionPackages);
-               }
-               
-               return missingPackages;
-       }
-       
-       /**
-        * save packages to installedpackage.list
-        * @param filePath
-        */
-       public void saveInstalledList(String filePath) {
-       if (filePath == null) {
-               return;
-       }
-        PropertyParser parser = new PropertyParser();
-        List<PropertySection> pSections = saveProperySectionsFromPackages(installedPackages);
-        parser.writeToFile(pSections, filePath);
-    }
-       
-       public List<PropertySection> saveProperySectionsFromPackages(PackageSet packages) {
-       List<PropertySection> pSections = new ArrayList<PropertySection>();
-       PropertySection pSection = null;
-       Properties properties = null;
-       
-       for (Package pkg : packages) {
-               properties = (Properties)pkg.getProperties();
-               pSection = new PropertySection();
-               pSection.setProperties(properties);
-               pSections.add(pSection);
-       }
-       
-       return pSections;
-    }
-       
-       /**
-        * Prints dependency graph of packages in dot format to stdout.
-        * @throws IMExitException 
-        */
-       public void printDepGraph() throws IMExitException {
-               StringBuffer buf = new StringBuffer();
-               try {
-                       buf.append("digraph G {\n");
-                       for(Package p : recentPackages) {
-                               PackageSet dep = dep(p, State.INSTALL);
-                               for(Package d : dep) {
-                                       if(!d.equals(p)) {
-                                               buf.append("\""+p+"\" -> \"" + d + "\";\n");
-                                       }
-                               }
-                       }
-                       buf.append("}\n");
-                       System.out.println(buf);
-               } catch(Exception e) {
-                       System.err.println(ErrorController.getErrorMessage()); // print error message to stderr for alert
-                       Log.ExceptionLog(e);
-                       throw new IMExitException(Config.EXITCODE_DEP_ERROR);
-               }
-       }
-       
-       public static void dispose() {
-               if (pm != null) {
-                       pm = null;
-               }
-       }
-
-       /**
-        * Get PackageManager singleton instance.
-        * @param installed
-        * @param repoPackagesUrls
-        * @return
-        * @throws IOException
-        */
-       public static PackageManager getInstance(File installed, Collection<String> repoPackagesUrls) throws IOException {
-               if (Options.platForm == null) {
-                       if (pm == null) {
-                               if (Platform.CURRENT_PLATFORM == Platform.LINUX_32
-                                               || Platform.CURRENT_PLATFORM == Platform.LINUX_64) {
-                                       pm = new LinuxPackageManager(installed, repoPackagesUrls);
-                               } else if (Platform.CURRENT_PLATFORM == Platform.WINDOWS_32
-                                               || Platform.CURRENT_PLATFORM == Platform.WINDOWS_64) {
-                                       pm = new WindowsPackageManager(installed, repoPackagesUrls);
-                               } else if (Platform.CURRENT_PLATFORM == Platform.MACOS_64) {
-                                       pm = new DarwinPackageManager(installed, repoPackagesUrls);
-                               } else {
-                                       return null;
-                               }
-                       }                       
-               } else {
-                       if (pm == null) {
-                               if (Options.platForm.equals("ubuntu")) {
-                                       pm = new LinuxPackageManager(installed, repoPackagesUrls);
-                               } else if (Options.platForm.equals("windows")) {
-                                       pm = new WindowsPackageManager(installed, repoPackagesUrls);
-                               } else {
-                                       return null;
-                               }
-                       }
-               }
-               return pm;
-       }
-       
-       public static PackageManager getInstance() {
-               return pm;
-       }
-}
diff --git a/SdkImageCreator/src/org/tizen/installmanager/pkg/lib/PropertyParser.java b/SdkImageCreator/src/org/tizen/installmanager/pkg/lib/PropertyParser.java
deleted file mode 100644 (file)
index 5d252b9..0000000
+++ /dev/null
@@ -1,305 +0,0 @@
-/*
-*  InstallManager
-*
-* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
-*
-* Contact: 
-* Wooyoung Cho <wooyoung1.cho@samsung.com>
-* Shihyun Kim <shihyun.kim@samsung.com>
-* Taeyoung Son <taeyoung2.son@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.pkg.lib;
-
-import java.io.*;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.tizen.installmanager.core.IMFatalException;
-import org.tizen.installmanager.lib.Log;
-import org.tizen.installmanager.lib.ErrorController.ErrorCode;
-import org.tizen.installmanager.pkg.model.Properties;
-import org.tizen.installmanager.pkg.model.Property;
-import org.tizen.installmanager.pkg.model.PropertySection;
-
-
-/**
- * Paring property from file.
- * @author Shihyun Kim <shihyun.kim@samsung.com>
- *
- */
-public class PropertyParser {
-       
-       public static final String DEFAULT_SECTION_SEPARATOR    = "";
-       public static final String DEFAULT_NAMEVALUE_SEPARATOR  = ":";
-       
-
-       private String mSectionSeparator        = DEFAULT_SECTION_SEPARATOR;
-       private String mNamevalueSeparator      = DEFAULT_NAMEVALUE_SEPARATOR;
-       
-       /**
-        * Set separator among section.
-        * @param separator
-        */
-       public void setSectionSeparator(String separator) {
-               mSectionSeparator = separator;
-       }
-       
-       /**
-        * Set separator between name and value
-        * @param separator
-        */
-       public void setNamevalueSeparator(String separator) {
-               mNamevalueSeparator = separator;
-       }
-       
-       
-       public PropertyParser() {
-       }
-       
-       public PropertyParser(String nameValueSeparator) {
-               mNamevalueSeparator = nameValueSeparator;
-       }
-       
-       /**
-        * Read text file and parsing.
-        * @param propertyFilePath
-        * @return list of PropertySection
-        */
-       public List<PropertySection> readFromFile(String propertyFilePath) {
-               Log.log("begin parsing the config file. => " + propertyFilePath);
-               
-           File file = new File(propertyFilePath);
-           if(!file.exists()) {
-               Log.log("Fail to parse the config file");
-               return null;
-           }
-           
-           List<PropertySection> pSectionReturn = null;
-               PropertySection pSection = null; 
-               Properties pFieldList = null;
-               Property pField = null;
-               Property tempProperty;
-               FileReader fReader = null;              
-               BufferedReader bReader = null;
-               String sReadData = null;
-               
-               try {                                                                   
-                       pFieldList = new Properties();                  
-                       pSectionReturn = new ArrayList<PropertySection>();
-                       fReader = new FileReader(propertyFilePath);
-                       bReader = new BufferedReader(fReader);
-                                       
-                       while (true) {                                  
-                               sReadData = bReader.readLine();
-                               Log.log(sReadData);
-                               
-                               //end of file.
-                               if (sReadData == null) {
-                                       if (pFieldList.size() > 0) {
-                                               pSection = new PropertySection();
-                                               pSection.setProperties(pFieldList);     
-                                               pSectionReturn.add(pSection);
-                                       } else {}
-                                       break;
-                               } else {
-                                       sReadData = sReadData.trim();
-                               }
-                               
-                               if (this.mSectionSeparator.equals(sReadData)) {                         
-                                       //read control
-                                       if (pFieldList.size() > 0) {
-                                               pSection = new PropertySection();
-                                               pSection.setProperties(pFieldList);     
-                                               pSectionReturn.add(pSection);
-                                               pFieldList = new Properties();
-                                       } else {
-                                               continue;
-                                       }
-                               } else {
-                                       //read line
-                                       tempProperty = parseNameValue(sReadData);
-                                       if (tempProperty != null) {
-                                               if (null != tempProperty.getName()) {
-                                                       pFieldList.add(tempProperty);
-                                                       pField = tempProperty;
-                                               } else {
-                                                       pField.setValue(pField.getValue()+'\n'+sReadData.trim());
-                                               }
-                                       } else {
-                                               Log.err("Cannot parse name and value from installmanager.conf. (read line => " + sReadData + ")");
-                                       }
-                               }
-                       }                       
-               } catch (IOException ie) {
-                       Log.ExceptionLog(ie);
-                       throw new IMFatalException(ErrorCode.CANNOT_PARSING_TEXT);
-               } catch (Throwable e) {
-                       Log.ExceptionLog(e);
-                       throw new IMFatalException(e.getMessage());
-               } finally {
-                       try {
-                               if(bReader      !=      null) {                 
-                                       bReader.close();
-                               }
-                       } catch(Exception e) {
-                               Log.ExceptionLog(e);
-                       }                               
-               }
-               
-               Log.log("finish parsing the config file.");
-               
-               return  pSectionReturn;
-       }
-       
-       /**
-        * Save name and value to Property.
-        * @param nameAndValue
-        * @return Property that has name and value from parameter '<code>nameAndValue</code>'.
-        */
-       public Property parseNameValue(String nameAndValue) {
-               
-               Property property = new Property();
-               String          sBeforeSetperation      =       null;
-               String          sAfterSetperation               =       null;
-               
-               int             iSetperationCount       =       nameAndValue.indexOf(mNamevalueSeparator); 
-               int             isKeyValueLength        =       nameAndValue.length();
-               
-               if (" ".equals(nameAndValue.substring(0, 1)) ) {
-                       property.setValue(nameAndValue.trim());
-               }
-               else if (iSetperationCount == -1) {
-                       property.setValue(nameAndValue.trim());
-               }
-               else if (iSetperationCount == isKeyValueLength) {
-                       property.setName(nameAndValue.substring(0, isKeyValueLength-1).trim());
-               }
-               else if (iSetperationCount      ==      0) {
-                       property.setValue(nameAndValue.substring(1,isKeyValueLength).trim());
-               }
-               else {
-                       //iSetperationCount > isKeyValueLength--> exception 
-                       sBeforeSetperation      =       nameAndValue.substring(0, iSetperationCount).trim();
-                       sAfterSetperation       =       nameAndValue.substring(iSetperationCount+ mNamevalueSeparator.length(), nameAndValue.length()).trim();
-                       
-                       property.setName(sBeforeSetperation);                           
-                       property.setValue(sAfterSetperation);   
-               }
-               
-               return property;
-       }
-       
-       /**
-        * Write Properties to file.
-        * @param properties List of PropertySection.
-        * @param targetPath
-        * @return <code>true</code> if success.
-        */
-       public boolean writeToFile(List<PropertySection> properties, String targetPath) {
-               if (properties == null || targetPath == null || targetPath.isEmpty()) {
-                       return false;
-               }
-               boolean                         bReturn                         =       false;
-               FileWriter              fWriter                         =       null;
-               Properties              pList                                   =       null;
-               Property                        pField                          =       null;
-               String                          sLine                                   =       "\n";           
-               String                          sSpace                          =       " ";
-               String                          sTemp                                   =       null;
-               String                          sPrintTemp              =       null;
-               
-               File targetFile = new File(targetPath);
-               File parentDir = targetFile.getParentFile();
-               
-               if (properties == null || targetPath == null ) {
-                       return false;
-               }
-               if (!parentDir.exists()) {
-                       parentDir.mkdirs();
-               }
-               if (!targetFile.exists()) {
-                       try {
-                               targetFile.createNewFile();
-                       } catch (IOException e) {
-                               throw new IMFatalException(ErrorCode.CANNOT_SAVE_PROPERTY_FILE);
-                       }
-               }
-               try {
-                       /*open*/
-                       fWriter =       new     FileWriter(targetPath);
-                       if (properties.size() == 0) {
-                               targetFile.delete();
-                               if (parentDir.getName().equals(".sdkconfig")) {
-                                       parentDir.delete();
-                               }
-                       } else {
-                               for (int        i=0;i<properties.size();i++) {
-                                       pList   =       properties.get(i).getProperties();
-                                       for (int j=0; j<pList.size();j++) {
-                                               pField  =       pList.get(j);
-                                               if (pField.getValue().indexOf(sLine)>-1) {
-                                                       fWriter.write(pField.getName());
-                                                       fWriter.write(this.mNamevalueSeparator);
-                                                       sTemp   =       pField.getValue();
-                                                       while (sTemp.indexOf(sLine) > -1) {
-                                                               sPrintTemp      =       sTemp.substring(0,sTemp.indexOf(sLine)+1);
-                                                               fWriter.write(sSpace +sPrintTemp);
-                                                               sTemp   =       sTemp.substring(sTemp.indexOf(sLine)+1, sTemp.length());
-                                                       }
-                                                       fWriter.write(sSpace+sTemp);
-                                                       fWriter.write(sLine);
-                                               } else {
-                                                       fWriter.write(pField.getName());
-                                                       fWriter.write(this.mNamevalueSeparator);
-                                                       fWriter.write(sSpace +pField.getValue());
-                                                       fWriter.write(sLine);
-                                               }                                       
-                                       }
-                                       fWriter.write(sLine);
-                               }                                               
-                       }
-               } catch (IOException ioe) {
-                       throw new IMFatalException(ErrorCode.CANNOT_SAVE_PROPERTY_FILE);
-               } catch (Throwable e) {
-                       Log.ExceptionLog(e);
-                       throw new IMFatalException(e.getMessage());
-               } finally {
-                       try {
-                               /*close*/
-                               if (fWriter     !=      null) {
-                                       fWriter.close();
-                                       }
-                               } catch (Throwable e) {
-                                       Log.ExceptionLog(e);
-                       }
-               }       
-               return  bReturn;                        
-       }
-
-       /**
-        * Read text file and parsing.
-        * @param propertyFilePath
-        * @return
-        */
-       public List<PropertySection> readFromFile(File installed) {
-               return readFromFile(installed.getAbsolutePath());
-       }       
-}
diff --git a/SdkImageCreator/src/org/tizen/installmanager/pkg/lib/darwin/DarwinPackageManager.java b/SdkImageCreator/src/org/tizen/installmanager/pkg/lib/darwin/DarwinPackageManager.java
deleted file mode 100644 (file)
index cd60b91..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-package org.tizen.installmanager.pkg.lib.darwin;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.Collection;
-
-import org.tizen.installmanager.core.Config;
-import org.tizen.installmanager.pkg.lib.PackageManager;
-
-public class DarwinPackageManager extends PackageManager  {
-
-       public DarwinPackageManager(File installed, Collection<String> repoPackagesUrls)
-                       throws IOException {
-               super(installed, repoPackagesUrls);
-       }
-
-       @Override
-       public String getPackageListFileName() {
-               return Config.PACKAGE_LIST_FILE_MACOS_64;
-       }
-
-}
diff --git a/SdkImageCreator/src/org/tizen/installmanager/pkg/lib/linux/LinuxPackageManager.java b/SdkImageCreator/src/org/tizen/installmanager/pkg/lib/linux/LinuxPackageManager.java
deleted file mode 100644 (file)
index 59f7390..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-package org.tizen.installmanager.pkg.lib.linux;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.Collection;
-
-import org.tizen.installmanager.core.Config;
-import org.tizen.installmanager.core.Options;
-import org.tizen.installmanager.lib.Platform;
-import org.tizen.installmanager.pkg.lib.PackageManager;
-
-/**
- * Package Manager for linux.
- * <p>
- * This class provides various methods for managing packages.
- * Most of the methods handle packages symbolically. Namely, they are identified by its package name not the object if not specially mentioned.
- * <p>
- * Some methods are carefully designed to preserve the order of packages because the order of packages is important sometimes. 
- * See the details in the documentation of each methods.
- * 
- * @author Shihyun Kim <shihyun.kim@samsung.com>
- *
- */
-public class LinuxPackageManager extends PackageManager {      
-       public LinuxPackageManager(File installed, Collection<String> repoPackagesUrls)
-                       throws IOException {
-               super(installed, repoPackagesUrls);
-       }
-
-       @Override
-       public String getPackageListFileName() {
-               if (Options.platFormBit != 0) {
-                       if (Options.platFormBit == 32) {
-                               return Config.PACKAGE_LIST_FILE_LINUX_32;
-                       } else if (Options.platFormBit == 64){
-                               return Config.PACKAGE_LIST_FILE_LINUX_64;
-                       }       
-               }
-               if (Platform.CURRENT_PLATFORM == Platform.LINUX_32) {
-                       return Config.PACKAGE_LIST_FILE_LINUX_32;
-               } else {
-                       return Config.PACKAGE_LIST_FILE_LINUX_64;
-               }
-       }
-}
diff --git a/SdkImageCreator/src/org/tizen/installmanager/pkg/lib/win/WindowsPackageManager.java b/SdkImageCreator/src/org/tizen/installmanager/pkg/lib/win/WindowsPackageManager.java
deleted file mode 100644 (file)
index e0aa73c..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-package org.tizen.installmanager.pkg.lib.win;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.Collection;
-
-import org.tizen.installmanager.core.Config;
-import org.tizen.installmanager.core.Options;
-import org.tizen.installmanager.lib.Platform;
-import org.tizen.installmanager.pkg.lib.PackageManager;
-
-/**
- * Package Manager for windows
- * <p>
- * This class provides various methods for managing packages.
- * Most of the methods handle packages symbolically. Namely, they are identified by its package name not the object if not specially mentioned.
- * <p>
- * Some methods are carefully designed to preserve the order of packages because the order of packages is important sometimes. 
- * See the details in the documentation of each methods.
- * 
- * @author Shihyun Kim <shihyun.kim@samsung.com>
- *
- */
-public class WindowsPackageManager extends PackageManager  {
-
-       public WindowsPackageManager (File installed,
-                       Collection<String> repoPackagesUrls) throws IOException {
-               super(installed, repoPackagesUrls);
-       }
-
-       @Override
-       public String getPackageListFileName() {
-               if (Options.platFormBit != 0) {
-                       if (Options.platFormBit == 32) {
-                               return Config.PACKAGE_LIST_FILE_WINDOWS_32;
-                       } else if (Options.platFormBit == 64){
-                               return Config.PACKAGE_LIST_FILE_WINDOWS_64;
-                       }       
-               }
-               if (Platform.CURRENT_PLATFORM == Platform.WINDOWS_32) {
-                       return Config.PACKAGE_LIST_FILE_WINDOWS_32;
-               } else {
-                       return Config.PACKAGE_LIST_FILE_WINDOWS_64;
-               }
-       }
-
-}
diff --git a/SdkImageCreator/src/org/tizen/installmanager/pkg/model/ConfigFile.java b/SdkImageCreator/src/org/tizen/installmanager/pkg/model/ConfigFile.java
deleted file mode 100644 (file)
index 4b63aa8..0000000
+++ /dev/null
@@ -1,473 +0,0 @@
-/*
- *  InstallManager
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: 
- * Wooyoung Cho <wooyoung1.cho@samsung.com>
- * Shihyun Kim <shihyun.kim@samsung.com>
- * Taeyoung Son <taeyoung2.son@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.pkg.model;
-
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.util.List;
-
-import org.tizen.installmanager.core.IMFatalException;
-import org.tizen.installmanager.lib.ErrorController;
-import org.tizen.installmanager.lib.Log;
-import org.tizen.installmanager.lib.ErrorController.ErrorCode;
-import org.tizen.installmanager.pkg.lib.PropertyParser;
-
-/**
- * This class describes the installmanager.conf file.
- * 
- * @author Shihyun Kim <shihyun.kim@samsung.com>
- * 
- */
-public class ConfigFile {
-       private static final String FIELD_REPOSITORY = "Repository";
-       private static final String FIELD_Distribution = "Distribution";
-       private static final String FIELD_PACKAGE_SERVER = "Package-Server";
-       private static final String FIELD_EXTENSION_SERVER = "Extension-Server";
-       private static final String FIELD_BUILT_IN_EXTENSION_SERVER = "Built-in-Extension-Server";
-       private static final String FIELD_INSTALLMANAGER_REPOSITORY = "InstallManager-Repository";
-       private static final String FIELD_INSTALLMANAGER_VERSION = "InstallManager-Version";
-       private static final String FIELD_PROXY_SERVER = "Proxy-server";
-       private static final String FIELD_PROXY_PORT = "Proxy-port";
-       private static final String FIELD_SNAPSHOT_PATH = "Snapshot-Path";
-       private static final String FIELD_RELEASE_NOTE = "Release-note";
-
-       private Properties mProperties;
-       private String mConfigFilePath;
-
-       public ConfigFile(String confPath) {
-               mProperties = new Properties();
-               if (!loadConfigFile(confPath)) {
-                       Log.err("Fail to load config file in this path : " + confPath);
-                       ErrorController.setError(ErrorCode.CANNOT_FIND_CONFIG_FILE);
-               } else {
-                       Log.log("Success to load config file in this path : " + confPath);
-               }
-       }
-
-       /**
-        * @return Repository of package list to install.
-        */
-       public String getRepository() {
-               return getValue(FIELD_REPOSITORY);
-       }
-       
-       /**
-        * @return Repository of package list to install.
-        */
-       public String getDistribution() {
-               return getValue(FIELD_Distribution);
-       }
-
-       /**
-        * @return Repository of installmanager to update installmanager's binary
-        */
-       public String getInstallManagerRepository() {
-               return getValue(FIELD_INSTALLMANAGER_REPOSITORY);
-       }
-
-       /**
-        * @return Version of installmanager
-        */
-       public String getInstallManagerVersion() {
-               return getValue(FIELD_INSTALLMANAGER_VERSION);
-       }
-       
-       /**
-        * @return Version of installmanager
-        */
-       public String getReleaseNoteUrl() {
-               return getValue(FIELD_RELEASE_NOTE);
-       }
-
-       /**
-        * @return proxy-server for connecting to repository.
-        */
-       public String getProxyServer() {
-               return getValue(FIELD_PROXY_SERVER);
-       }
-
-       /**
-        * Set proxy server ip.
-        * 
-        * @param proxyServer
-        */
-       public void setProxyServer(String proxyServer) {
-               Property property = getProperty(ConfigFile.FIELD_PROXY_SERVER);
-
-               if (property != null) {
-                       property.setValue(proxyServer);
-               } else {
-                       property = new Property();
-                       property.setName(ConfigFile.FIELD_PROXY_SERVER);
-                       property.setValue(proxyServer);
-
-                       mProperties.add(property);
-               }
-       }
-
-       /**
-        * @return port number for proxy. -1 if not specified.
-        */
-       public int getProxyPort() {
-               String proxyPortStr = getValue(FIELD_PROXY_PORT);
-               try {
-                       if (!proxyPortStr.isEmpty()) {
-                               return Integer.parseInt(proxyPortStr);
-                       } else {
-                               return -1;
-                       }
-               } catch (NumberFormatException e) {
-                       Log.log("Invalid proxy port");
-                       return -1;
-               }
-       }
-
-       /**
-        * Set proxy port
-        * 
-        * @param proxyPort
-        */
-       public void setProxyPort(String proxyPort) {
-               Property property = getProperty(ConfigFile.FIELD_PROXY_PORT);
-
-               if (property != null) {
-                       property.setValue(proxyPort);
-               } else {
-                       property = new Property();
-                       property.setName(ConfigFile.FIELD_PROXY_PORT);
-                       property.setValue(proxyPort);
-
-                       mProperties.add(property);
-               }
-       }
-       
-       /**
-        * @return Package-server for downloading packages.
-        */
-       public String getPackageServer() {
-               return getValue(FIELD_PACKAGE_SERVER);
-       }
-       
-       /**
-        * Set package server
-        * 
-        * @param packageServer package server address.
-        */
-       public void setPackageServer(String packageServer) {
-               Property property = getProperty(ConfigFile.FIELD_PACKAGE_SERVER);
-
-               if (property != null) {
-                       property.setValue(packageServer);
-               } else {
-                       property = new Property();
-                       property.setName(ConfigFile.FIELD_PACKAGE_SERVER);
-                       property.setValue(packageServer);
-
-                       mProperties.add(property);
-               }
-       }
-       
-       /**
-        * @return snapshot path from repository.
-        */
-       public String getSnapshotPath() {
-               return getValue(FIELD_SNAPSHOT_PATH);
-       }
-       
-       /**
-        * Set snapshot path from repository
-        * 
-        * @param snapshot path.
-        */
-       public void setSnapshotPath(String snapshotPath) {
-               Property property = getProperty(ConfigFile.FIELD_SNAPSHOT_PATH);
-
-               if (property != null) {
-                       property.setValue(snapshotPath);
-               } else {
-                       property = new Property();
-                       property.setName(ConfigFile.FIELD_SNAPSHOT_PATH);
-                       property.setValue(snapshotPath);
-
-                       mProperties.add(property);
-               }
-       }
-       
-       /**
-        * @return Built-in Extension-server for downloading packages.
-        */
-       public String getBuiltInExtensionServer() {
-               return getValue(FIELD_BUILT_IN_EXTENSION_SERVER);
-       }
-       
-       /**
-        * @return Extension-server for downloading packages.
-        */
-       public String getExtensionServer() {
-               return getValue(FIELD_EXTENSION_SERVER);
-       }
-       
-       /**
-        * Set package server
-        * 
-        * @param packageServer package server address.
-        */
-       public void setExtensionServer(String extensionServer) {
-               Property property = getProperty(ConfigFile.FIELD_EXTENSION_SERVER);
-
-               if (property != null) {
-                       property.setValue(extensionServer);
-               } else {
-                       property = new Property();
-                       property.setName(ConfigFile.FIELD_EXTENSION_SERVER);
-                       property.setValue(extensionServer);
-
-                       mProperties.add(property);
-               }
-       }
-       
-       /**
-        * Get Property instance from configuration key.
-        * 
-        * @param key
-        * @return
-        */
-       private Property getProperty(String key) {
-               if (mProperties != null && key != null) {
-                       for (int i = 0; i < mProperties.size(); i++) {
-                               if (key.compareTo(mProperties.get(i).getName()) == 0) {
-                                       return mProperties.get(i);
-                               }
-                       }
-               }
-               return null;
-       }
-
-       /**
-        * @param key
-        * @return Get value from configuration key.
-        */
-       public String getValue(String key) {
-               Property property = getProperty(key);
-
-               if (property != null) {
-                       return property.getValue();
-               } else {
-                       return "";
-               }
-       }
-
-       /**
-        * Get properties instance from this class
-        * 
-        * @return
-        */
-       public Properties getProperties() {
-               return mProperties;
-       }
-
-       /**
-        * Set Properties instance to this class.
-        * 
-        * @param properties
-        */
-       public void setProperties(Properties properties) {
-               this.mProperties = properties;
-       }
-
-       /**
-        * Set installmanager's version
-        * 
-        * @param version
-        */
-       public void setInstallManagerVersion(String version) {
-               Property property = getProperty(ConfigFile.FIELD_INSTALLMANAGER_VERSION);
-
-               if (property != null) {
-                       property.setValue(version);
-               } else {
-                       property = new Property();
-                       property.setName(ConfigFile.FIELD_INSTALLMANAGER_VERSION);
-                       property.setValue(version);
-
-                       mProperties.add(property);
-               }
-       }
-
-       /**
-        * Get sdk repository.
-        * @param repository
-        */
-       public void setRepository(String repository) {
-               Property property = getProperty(ConfigFile.FIELD_REPOSITORY);
-
-               if (property != null) {
-                       property.setValue(repository);
-               } else {
-                       property = new Property();
-                       property.setName(ConfigFile.FIELD_REPOSITORY);
-                       property.setValue(repository);
-
-                       mProperties.add(property);
-               }
-       }
-       
-       /**
-        * Get current distribution in repository.
-        * @param distribution
-        */
-       public void setDistribution(String distribution) {
-               Property property = getProperty(ConfigFile.FIELD_Distribution);
-
-               if (property != null) {
-                       property.setValue(distribution);
-               } else {
-                       property = new Property();
-                       property.setName(ConfigFile.FIELD_Distribution);
-                       property.setValue(distribution);
-
-                       mProperties.add(property);
-               }
-       }
-
-       /**
-        * Load config file from configFilePath.
-        * 
-        * @param configFilePath
-        * @return
-        */
-       private boolean loadConfigFile(String configFilePath) {
-               List<PropertySection> propertySections = null;
-
-               File configFile = new File(configFilePath);
-
-               if (!configFile.exists()) {
-                       return false;
-               } else {
-                       setConfigPath(configFilePath);
-               }
-
-               PropertyParser parser = new PropertyParser();
-               propertySections = parser.readFromFile(configFilePath);
-
-               return loadFromProperties(propertySections);
-       }
-
-       /**
-        * Read PropertySection and make ConfigFile instance
-        * 
-        * @param propertySections
-        * @return
-        */
-       public boolean loadFromProperties(List<PropertySection> propertySections) {
-               if ((propertySections == null) || (propertySections.size() == 0)) {
-                       Log.log("(propertySections == null) || (propertySections.size() == 0)");
-                       return false;
-               }
-
-               this.setProperties(propertySections.get(0).getProperties());
-               return true;
-       }
-
-       /**
-        * save config file to configFilePath.
-        * 
-        * @param configFilePath
-        *            config file path
-        */
-       public void saveConfig(String configFilePath) {
-               Log.log("Config save config start => " + configFilePath);
-               if (this == null) {
-                       Log.err("No config object");
-                       return;
-               } else {
-               }
-
-               if (configFilePath == null || configFilePath.equals("")) {
-                       Log.err("Invalid config file path");
-                       return;
-               }
-
-               File configFile = new File(configFilePath);
-               if (configFile.exists()) {
-                       configFile.delete();
-               }
-
-               File parentDir = configFile.getParentFile();
-               if (!parentDir.exists()) {
-                       parentDir.mkdirs();
-               } else {
-               }
-
-               try {
-                       configFile.createNewFile();
-               } catch (IOException e1) {
-                       Log.err("Cannot create config file => " + configFilePath);
-                       throw new IMFatalException(ErrorCode.CANNOT_SAVE_CONFIG);
-               }
-
-               BufferedWriter writer = null;
-               try {
-                       writer = new BufferedWriter(new FileWriter(configFile));
-
-                       Properties repoProperties = this.getProperties();
-                       for (int i = 0; i < repoProperties.size(); i++) {
-                               writer.write(repoProperties.get(i).getName() + ": "
-                                               + repoProperties.get(i).getValue() + "\n");
-                       }
-
-                       writer.write("\n");
-               } catch (IOException e) {
-                       Log.err("Cannot write config file");
-                       throw new IMFatalException(ErrorCode.CANNOT_SAVE_CONFIG);
-               } finally {
-                       try {
-                               if (writer != null) {
-                                       writer.close();
-                               }
-                       } catch (IOException e) {
-                               Log.err("close fileoutput fail");
-                       }
-               }
-               Log.log("Config save config end");
-       }
-
-       private void setConfigPath(String configPath) {
-               mConfigFilePath = configPath;
-       }
-
-       /**
-        * @return Config file path that installer is using config file now.
-        */
-       public String getConfigPath() {
-               return mConfigFilePath;
-       }
-}
diff --git a/SdkImageCreator/src/org/tizen/installmanager/pkg/model/Distribution.java b/SdkImageCreator/src/org/tizen/installmanager/pkg/model/Distribution.java
deleted file mode 100644 (file)
index 846665f..0000000
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- *  InstallManager
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: 
- * Wooyoung Cho <wooyoung1.cho@samsung.com>
- * Shihyun Kim <shihyun.kim@samsung.com>
- * Taeyoung Son <taeyoung2.son@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.pkg.model;
-
-import java.util.List;
-
-/**
- * This class describes a distribution.
- * This class cannot change variable.
- * 
- * @author Shihyun Kim <shihyun.kim@samsung.com>
- * 
- */
-public class Distribution {
-       private static final String FIELD_NAME = "name";
-       private static final String FIELD_DATE = "time";
-
-       private String repository = "";
-       private List<Property> mProperties;
-       
-       /**
-        * Constructor.
-        * 
-        * @param properties
-        *            Set <code>properties</code> to member variable.
-        */
-       public Distribution(String repo, List<Property> properties) {
-               this.repository = repo; 
-               this.mProperties = properties;
-       }
-
-       /**
-        * Get snapshot name.
-        * @return
-        */
-       public String getName() {
-               return getValue(FIELD_NAME);
-       }
-       
-       /**
-        * Get intended date of snapshot
-        * @return
-        */
-       public String getDate() {
-               return getValue(FIELD_DATE);
-       }
-
-       /**
-        * Get Property instance from configuration key.
-        * 
-        * @param key
-        * @return
-        */
-       private Property getProperty(String key) {
-               for (Property prop : mProperties) {
-                       if (prop.getName().equals(key)) {
-                               return prop;
-                       }
-               }
-               return null;
-       }
-
-       /**
-        * @return List of Property instance.
-        */
-       public List<Property> getProperties() {
-               return mProperties;
-       }
-       
-       public String getRepository() {
-               return this.repository;
-       }
-
-       /**
-        * @param key
-        * @return string value of the property name. empty string if there's no
-        *         such property name
-        */
-       private String getValue(String key) {
-               Property property = getProperty(key);
-               if (property == null) {
-                       return null;
-               } else {
-                       return property.getValue();
-               }
-       }
-       
-       public String toString() {
-               return getName();
-       }
-}
diff --git a/SdkImageCreator/src/org/tizen/installmanager/pkg/model/DistributionSet.java b/SdkImageCreator/src/org/tizen/installmanager/pkg/model/DistributionSet.java
deleted file mode 100644 (file)
index 9f436c4..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-/* 
-*  InstallManager
-*
-* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
-*
-* Contact: 
-* Wooyoung Cho <wooyoung1.cho@samsung.com>
-* Shihyun Kim <shihyun.kim@samsung.com>
-* Taeyoung Son <taeyoung2.son@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.pkg.model;
-
-import java.util.LinkedHashSet;
-
-/**
- * This class describes a snapshot list.
- * 
- * @author Shihyun Kim <shihyun.kim@samsung.com>
- *
- */
-@SuppressWarnings("serial")
-public class DistributionSet extends LinkedHashSet<Distribution>{
-       public final static DistributionSet EMPTY = new DistributionSet();
-       
-       /**
-        * Finds and returns a snapshot in this set with the same name of the given snapshot.
-        * You have to check the existence with <code>contains()</code> method before calling this method.
-        * @param p0
-        * @return a snapshot that has same name with the given snapshot.
-        * <code>null</code> when cannot find the snapshot 
-        */
-       public Distribution getDistribution(Distribution dist) {
-               for(Distribution d : this) {
-                       if(d.equals(dist)) {
-                               return d;
-                       }
-               }
-               return null;
-       }
-       
-       /**
-        * @param snapshot Name
-        * @return snapshot object that has the snapshot name. 
-        * <code>null</code> when cannot find the snapshot
-        */
-       public Distribution getDistributionByName(String distName) {
-               for(Distribution d : this) {
-                       String name = d.getName();
-                       
-                       if (name != null) {
-                               if(name.equals(distName)) {
-                                       return d;
-                               }
-                       }
-               }
-               return null;
-       }
-}
diff --git a/SdkImageCreator/src/org/tizen/installmanager/pkg/model/IMPackageNotFound.java b/SdkImageCreator/src/org/tizen/installmanager/pkg/model/IMPackageNotFound.java
deleted file mode 100644 (file)
index 12d3b9a..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
-*  InstallManager
-*
-* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
-*
-* Contact: 
-* Wooyoung Cho <wooyoung1.cho@samsung.com>
-* Shihyun Kim <shihyun.kim@samsung.com>
-* Taeyoung Son <taeyoung2.son@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.pkg.model;
-
-/**
- * This exception is thrown when a package is not found.
- * 
- * @author Wooyoung Cho <wooyoung1.cho@samsung.com>
- *
- */
-public class IMPackageNotFound extends Exception {
-
-       private static final long serialVersionUID = -2065916984023295931L;
-
-       private String packageName;
-       
-       public IMPackageNotFound(String name) {
-               this.packageName = name;
-       }
-
-       /**
-        * @return Name of package that cannot be found.
-        */
-       public String getPackageName() {
-               return packageName;
-       }
-
-
-}
diff --git a/SdkImageCreator/src/org/tizen/installmanager/pkg/model/Package.java b/SdkImageCreator/src/org/tizen/installmanager/pkg/model/Package.java
deleted file mode 100644 (file)
index 3c903a4..0000000
+++ /dev/null
@@ -1,501 +0,0 @@
-/*
-*  InstallManager
-*
-* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
-*
-* Contact: 
-* Wooyoung Cho <wooyoung1.cho@samsung.com>
-* Shihyun Kim <shihyun.kim@samsung.com>
-* Taeyoung Son <taeyoung2.son@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.pkg.model;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.List;
-
-import org.tizen.installmanager.core.Config;
-import org.tizen.installmanager.core.IMFatalException;
-import org.tizen.installmanager.core.Options;
-import org.tizen.installmanager.lib.ErrorController.ErrorCode;
-import org.tizen.installmanager.lib.Log;
-import org.tizen.installmanager.lib.Platform;
-
-/**
- * This class describes a package.
- * 
- * @author Wooyoung Cho <wooyoung1.cho@samsung.com>
- *
- */
-public class Package {
-       
-       // fields of package control
-       // mandatory
-       public static final String FIELD_PACKAGE                = "Package";
-       public static final String FIELD_VERSION                = "Version";
-       public static final String FIELD_LABEL = "Label";
-       public static final String FIELD_MAINTAINER     = "Maintainer";
-       public static final String FIELD_DESCRIPTION    = "Description";
-
-       // etc
-       public static final String FIELD_DEPENDS                = "Install-dependency"; // list of packages that this package depends on
-       public static final String FIELD_CONFLICTS              = "Conflicts";
-       public static final String FIELD_PACKAGE_SIZE   = "Size"; // size of zipped package
-       //      public static final String FIELD_INSTALLEDSIZE  = "Installed-Size"; // TODO implement
-       
-       // fields of installed control
-       public static final String FIELD_ATTRIBUTE              = "Attribute";
-       
-       // fields of repository control
-       public static final String FIELD_SHA256         = "SHA256";
-       public static final String FIELD_FILE_PATH      = "Path"; // path from the base url
-       
-       // fields of ordering for UI
-       public static final String FIELD_ORDER = "C-Order";
-       
-       // field of Partner SDK
-       public static final String FIELD_PARTNER = "C-Partner";
-       
-       // fields of script
-       public static final String INSTALL_SCRIPT_LINUX = "install.sh";
-       public static final String REMOVE_SCRIPT_LINUX = "remove.sh";
-       public static final String INSTALL_SCRIPT_WINDOWS = "Install.bat";
-       public static final String REMOVE_SCRIPT_WINDOWS = "Remove.bat";
-       
-       // fields of ui control
-       public static final String FIELD_DEFAULT_CHECK = "Default";
-       
-       //field of extension server. this field is used by installed list.
-       public static final String FIELD_EXTENSION_SERVER = "Extension-server"; 
-       
-       // attribute value
-       private static final String ATTRIBUTE_ROOT_META = "root";
-       private static final String ATTRIBUTE_EXTRA_META = "extra";
-       private static final String ATTRIBUTE_INSTALL_META = "install";
-       private static final String ATTRIBUTE_MANDATORY = "mandatory";
-       private static final String ATTRIBUTE_PARTNER = "partner";
-       private static final String ATTRIBUTE_PUBLIC = "public";
-       
-       //dependency information
-       private final String START_OF_OS_DEPENDENCY = "[";
-       
-       private List<Property> mProperties;
-       private URL url; // url to the package zip file
-       
-       private final int LOWEST_ORDER = 100;
-       
-       public Package(List<Property> properties) {
-               this.mProperties = properties;
-       }
-
-       /**
-        * Make url of package.
-        * @param properties package
-        * @param repoBaseUrl url before snapshot path.
-        */
-       public Package(Properties properties, String repoBaseUrl) {
-               this(properties);
-               try {
-                       if (Config.fromWhere == Config.ConfDialog.LOCAL_IMAGE) { // data from file dialog for local installing
-                               this.url = new URL(repoBaseUrl + "/" +  getValue(FIELD_FILE_PATH));
-                       } else { // data from snapshot and normal 'next' case
-                               this.url = new URL(repoBaseUrl + "/" +  getValue(FIELD_FILE_PATH));                             
-                       }
-               } catch (MalformedURLException e) {
-                       Log.err("Invalid package url: "+repoBaseUrl + "/" +  getValue(FIELD_FILE_PATH));
-                       throw new IMFatalException(ErrorCode.WRONG_PACKAGE_URL);
-               }
-       }
-
-       /**
-        * @return version of this package
-        */
-       public Version getVersion() {
-               return new Version(getValue(FIELD_VERSION));
-       }
-
-       /**
-        * @return package name of this package
-        */
-       public String getPackageName() {
-               return getValue(FIELD_PACKAGE);
-       }
-       
-       /**
-        * @return name of package.
-        */
-       public String getLabel() {
-               return getValue(FIELD_LABEL);
-       }
-       
-       /**
-        * @return the size of zipped package file 
-        */
-       public Long getPackageSize() {
-               long result = 0;
-               try {
-                       result = Long.parseLong(getValue(FIELD_PACKAGE_SIZE));
-               } catch(NumberFormatException e) {
-                       Log.err(toString() + " size do not exist.");
-                       Log.ExceptionLog(e);
-               }
-               
-               return result;
-       }
-       
-       /**
-        * @return Path of this package File from repository. 
-        */
-       public String getFileName() {
-               return getValue(FIELD_FILE_PATH);
-       }
-       
-       /**
-        * @return Description of this package.
-        */
-       public String getDescription() {
-               return getValue(FIELD_DESCRIPTION);
-       }
-       
-       /**
-        * @return SHA256 digest of this package file.
-        */
-       public String getSHA256() {
-               return getValue(FIELD_SHA256);
-       }
-       
-       /**
-        * @return URL to the package file in repository.
-        */
-       public URL getURL() {
-               return url;
-       }
-       
-       public String getPartner() {
-               return getValue(FIELD_PARTNER);
-       }
-       
-       /**
-        * @return Extension server of this package.
-        */
-       public String getExtensionServer() {
-               return getValue(FIELD_EXTENSION_SERVER);
-       }
-       
-       /**
-        * Set extension server to package information.
-        * @param extensionServer extension server of this packge
-        */
-       public void setExtensionServer(String extensionServer) {
-               Property property = getProperty(FIELD_EXTENSION_SERVER);
-
-               if (property != null) {
-                       property.setValue(extensionServer);
-               } else {
-                       property = new Property();
-                       property.setName(FIELD_EXTENSION_SERVER);
-                       property.setValue(extensionServer);
-
-                       mProperties.add(property);
-               }
-       }
-       /**
-        * Get package order for InstallManager displaying package tree.
-        * @return package order
-        */
-       public int getOrder() {
-               String order = getValue(FIELD_ORDER);
-               if (order.equals("")) {
-                       return LOWEST_ORDER;
-               } else {
-                       int nOrder = 0;
-                       try {
-                               nOrder = Integer.parseInt(order);
-                       } catch (NumberFormatException e) {
-                               Log.err("C-Order field value is not a integer format.");
-                               return 100;
-                       }
-                       return nOrder;                  
-               }
-       }
-       
-       /**
-        * @return Remove Script name of this package.
-        */
-       public String getRemoveScript() {
-               if (Platform.CURRENT_PLATFORM == Platform.LINUX_32
-                               || Platform.CURRENT_PLATFORM == Platform.LINUX_64) {
-                       return REMOVE_SCRIPT_LINUX;
-               } else if (Platform.CURRENT_PLATFORM == Platform.WINDOWS_32
-                               || Platform.CURRENT_PLATFORM == Platform.WINDOWS_64) {
-                       return REMOVE_SCRIPT_WINDOWS;
-               } else if (Platform.CURRENT_PLATFORM == Platform.MACOS_64) {
-                       return "";
-               }       else {}
-               return null;
-       }
-       
-       /**
-        * @return Install script name of this package.
-        */
-       public String getInstallScript() {
-               if (Platform.CURRENT_PLATFORM == Platform.LINUX_32
-                               || Platform.CURRENT_PLATFORM == Platform.LINUX_64
-                               || Platform.CURRENT_PLATFORM == Platform.MACOS_64
-                               || Platform.CURRENT_PLATFORM == Platform.MACOS_32) {
-                       return INSTALL_SCRIPT_LINUX;
-               } else if (Platform.CURRENT_PLATFORM == Platform.WINDOWS_32
-                               || Platform.CURRENT_PLATFORM == Platform.WINDOWS_64) {
-                       return INSTALL_SCRIPT_WINDOWS;
-               } else {}
-               return null;
-       }
-       
-       /**
-        * @return List of Property instance.
-        */
-       public List<Property> getProperties() {
-               return mProperties;
-       }
-       
-       /**
-        * Get Property instance from key.
-        * 
-        * @param key
-        * @return
-        */
-       private Property getProperty(String key) {
-               if (mProperties != null && key != null) {
-                       for (int i = 0; i < mProperties.size(); i++) {
-                               if (key.compareTo(mProperties.get(i).getName()) == 0) {
-                                       return mProperties.get(i);
-                               }
-                       }
-               }
-               return null;
-       }
-
-       /**
-        * @param propertyName
-        * @return string value of the property name. empty string if there's no such property name
-        */
-       private String getValue(String propertyName) {
-               for(Property prop : mProperties) {
-                       if(prop.getName().equals(propertyName)) {
-                               return prop.getValue();
-                       }
-               }
-               return "";
-       }
-       
-       /**
-        * @return Attribute value.
-        */
-       public String getAttribute() {
-               return getValue(FIELD_ATTRIBUTE);
-       }
-
-       /**
-        * @return <code>true</code> if this package is a meta package.
-        */
-       public boolean isMeta() {
-               // onlyDownload option, in this case, do not need separate public meta package 
-               // to partner meta package because installmanager should download all meta packages.
-               if (Options.onlyDownload) {
-                       if (isRootMeta() || isInstallMeta() || isExtraMeta() ||
-                                       isPublicMeta() || isPartnerMeta() || isMandatory()) {
-                               return true;
-                       } else {
-                               return false;
-                       }
-               }
-               
-               if (!Options.partnerSdk) { // public download case
-                       if (isRootMeta() || isInstallMeta() || isExtraMeta() || isMandatory() || isPublicMeta()) {
-                               return true;
-                       } else {
-                               return false;
-                       }
-               } else { // partner download case
-                       if (isRootMeta() || isInstallMeta() || isExtraMeta() || isMandatory() || isPartnerMeta()) {
-                               return true;
-                       } else {
-                               return false;
-                       }
-               }
-       }
-       
-       /**
-        * @return <code>true</code> if this package is a root meta package.
-        */
-       public boolean isRootMeta() {
-               String attributeValue = getAttribute().trim();
-               
-               if (attributeValue.equalsIgnoreCase(ATTRIBUTE_ROOT_META)) {
-                       return true;
-               } else {
-                       return false;
-               }
-       }
-       
-       /**
-        * @return <code>true</code> if this package is a extra meta package.
-        */
-       public boolean isExtraMeta() {
-               String attributeValue = getAttribute().trim();
-               
-               if (attributeValue.equalsIgnoreCase(ATTRIBUTE_EXTRA_META)) {
-                       return true;
-               } else {
-                       return false;
-               }
-       }
-       
-       /**
-        * Check to belong to partner sdk given package
-        * @return <code>true</code> if this package is a partner package.
-        */
-       public boolean isPartnerMeta() {
-               String attributeValue = getAttribute().trim();
-               
-               if (attributeValue.equalsIgnoreCase(ATTRIBUTE_PARTNER)) {
-                       return true;
-               } else {
-                       return false;
-               }               
-       }
-       
-       /**
-        * Check to belong to partner sdk given package
-        * @return <code>true</code> if this package is a partner package.
-        */
-       public boolean isPublicMeta() {
-               String attributeValue = getAttribute().trim();
-               
-               if (attributeValue.equalsIgnoreCase(ATTRIBUTE_PUBLIC)) {
-                       return true;
-               } else {
-                       return false;
-               }
-       }       
-       
-       /**
-        * @return <code>true</code> if this meta package is a install meta package.
-        */
-       public boolean isInstallMeta() {
-               String attributeValue = getAttribute().trim();
-               
-               if (attributeValue.equalsIgnoreCase(ATTRIBUTE_INSTALL_META)) {
-                       return true;
-               } else {
-                       return false;
-               }
-       }
-       
-       /**
-        * @return <code>true</code>, if this package is a mandatory package. This package must install.
-        */
-       public boolean isMandatory() {
-               String attributeValue = getAttribute().trim();
-               
-               if (attributeValue.equalsIgnoreCase(ATTRIBUTE_MANDATORY)) {
-                       return true;
-               } else {
-                       return false;
-               }
-       }
-       
-       public boolean isExtensionPackage() {
-               String extensionServer = getExtensionServer();
-               
-               if (extensionServer == null || extensionServer.isEmpty()) {
-                       return false;
-               } else {
-                       return true;
-               }
-       }
-
-       /**
-        * @return package names that this package directly depends on
-        */
-       public Collection<String> getDependentPackageNames() {
-               HashSet<String> depends = new HashSet<String>();
-               String dependsStr = getValue(FIELD_DEPENDS);
-               String deps[] = dependsStr.split(",");
-               for(int i = 0; i < deps.length; i++) {
-                       String dep = removeOSInformationOfDepends(deps[i]);
-
-                       if(!dep.isEmpty()) {
-                               depends.add(dep);
-                       }
-               }
-               return depends;
-       }
-       
-       private String removeOSInformationOfDepends(String info) {      
-               //Log.log("Package.removeOSInformation (info => " + info + ")");
-               
-               if (info.contains(START_OF_OS_DEPENDENCY)) {
-                       int index = info.indexOf(START_OF_OS_DEPENDENCY);
-                       String pkgInfo = info.substring(0, index).trim();
-                       
-                       return pkgInfo;
-               } else {
-                       return info.trim();
-               }
-       }
-
-       /**
-        * @return package names that this package directly conflicts to
-        */
-       public Collection<String> getConflictPackageNames() {
-               HashSet<String> conflicts = new HashSet<String>();
-               String conflictsStr = getValue(FIELD_CONFLICTS);
-               String confs[] = conflictsStr.split(",");
-               for(int i = 0; i < confs.length; i++) {
-                       conflicts.add(confs[i].trim());
-               }
-               return conflicts;
-       }
-       
-       public String toString() {
-               return getPackageName();
-       }
-       
-       /**
-        * Checks equality symbolically only using their package names.
-        * @return <code>true</code> if they have the same package name.
-        */
-       public boolean equals(Object obj) {
-               if (obj instanceof Package) {
-                       Package pkg2 = (Package)obj;
-                       return this.getPackageName().equals(pkg2.getPackageName());
-               } else {
-                       return false;
-               }
-       }
-       
-       public int hashCode() {
-               return getPackageName().hashCode();
-       }
-}
diff --git a/SdkImageCreator/src/org/tizen/installmanager/pkg/model/PackageSet.java b/SdkImageCreator/src/org/tizen/installmanager/pkg/model/PackageSet.java
deleted file mode 100644 (file)
index 37c9b45..0000000
+++ /dev/null
@@ -1,120 +0,0 @@
-/* 
-*  InstallManager
-*
-* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
-*
-* Contact: 
-* Wooyoung Cho <wooyoung1.cho@samsung.com>
-* Shihyun Kim <shihyun.kim@samsung.com>
-* Taeyoung Son <taeyoung2.son@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.pkg.model;
-
-import java.util.Collection;
-import java.util.LinkedHashSet;
-
-
-/**
- * This class represents a set of packages.
- * Even though this is a set, it preserves the order that elements are added. Iteration on this set will be in the order elements are added.
- * 
- * @author Wooyoung Cho <wooyoung1.cho@samsung.com>
- */
-@SuppressWarnings("serial")
-public class PackageSet extends LinkedHashSet<Package>{
-       public final static PackageSet EMPTY = new PackageSet();
-       
-       /**
-        * Finds and returns a package in this set with the same name of the given package.
-        * You have to check the existence with <code>contains()</code> method before calling this method.
-        * @param p0
-        * @return a package that has same name with the given package.
-        * <code>null</code> when cannot find the package 
-        */
-       public Package getPackage(Package p0) {
-               for(Package p : this) {
-                       if(p.equals(p0)) {
-                               return p;
-                       }
-               }
-               return null;
-       }
-       
-       /**
-        * @param packageName
-        * @return package object that has the package name. 
-        * <code>null</code> when cannot find the package
-        */
-       public Package getPackageByName(String packageName) {
-               if (packageName == null) {
-                       return null;
-               }
-               
-               for(Package p : this) {
-                       if(p.getPackageName().equals(packageName)) {
-                               return p;
-                       }
-               }
-               return null;
-       }
-       
-       /**
-        * @param packageName
-        * @return true if there's a package with the package name
-        */
-       public boolean hasPackageByName(String packageName) {
-               for(Package p : this) {
-                       if(p.getPackageName().equals(packageName)) {
-                               return true;
-                       }
-               }
-               return false;
-       }
-       
-       /**
-        * exist pkg in this package set.
-        * @param package instance
-        * @return true if there's a package.
-        */
-       public boolean hasPackage(Package pkg) {
-               if (getPackage(pkg) == null) {
-                       return false;
-               } else {
-                       return true;
-               }
-       }
-
-       /**
-        * @param names
-        * @return packages that have the names among this package set. 
-        * @throws IMPackageNotFound thrown if any one of the name is not found. 
-        */
-       public PackageSet getPackagesByNames(Collection<String> names) throws IMPackageNotFound {
-               PackageSet pset = new PackageSet();
-               for(String name : names) {
-                       Package pkg = getPackageByName(name);
-                       if(pkg != null) {
-                               pset.add(pkg);
-                       }
-               }
-               return pset;
-       }
-}
diff --git a/SdkImageCreator/src/org/tizen/installmanager/pkg/model/Properties.java b/SdkImageCreator/src/org/tizen/installmanager/pkg/model/Properties.java
deleted file mode 100644 (file)
index 825a4db..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
-*  InstallManager
-*
-* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
-*
-* Contact: 
-* Wooyoung Cho <wooyoung1.cho@samsung.com>
-* Shihyun Kim <shihyun.kim@samsung.com>
-* Taeyoung Son <taeyoung2.son@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.pkg.model;
-
-import java.util.ArrayList;
-
-/**
- * This class describes list of property. 
- * @author Shihyun Kim <shihyun.kim@samsung.com>
- *
- */
-@SuppressWarnings("serial")
-public class Properties extends ArrayList<Property>{
-
-}
diff --git a/SdkImageCreator/src/org/tizen/installmanager/pkg/model/Property.java b/SdkImageCreator/src/org/tizen/installmanager/pkg/model/Property.java
deleted file mode 100644 (file)
index 2f9350b..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
-*  InstallManager
-*
-* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
-*
-* Contact: 
-* Wooyoung Cho <wooyoung1.cho@samsung.com>
-* Shihyun Kim <shihyun.kim@samsung.com>
-* Taeyoung Son <taeyoung2.son@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.pkg.model;
-
-/**
- * This class can describes a key and a value from data.
- * 
- * @author Shihyun Kim <shihyun.kim@samsung.com>
- *
- */
-public class Property {
-       
-       private String mName;
-       private String mValue;
-       
-       /**
-        * @return Name of data.
-        */
-       public String getName() {
-               return mName;
-       }
-       /**
-        * Set name of data.
-        * @param name
-        */
-       public void setName(String name) {
-               this.mName = name;
-       }
-       
-       /**
-        * @return Value of data.
-        */
-       public String getValue() {
-               return mValue;
-       }
-       /**
-        * Set value of data
-        * @param value
-        */
-       public void setValue(String value) {
-               this.mValue = value;
-       }
-       
-       public String toString() {
-               return mName+":"+mValue;
-       }
-}
diff --git a/SdkImageCreator/src/org/tizen/installmanager/pkg/model/PropertySection.java b/SdkImageCreator/src/org/tizen/installmanager/pkg/model/PropertySection.java
deleted file mode 100644 (file)
index a31876e..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
-*  InstallManager
-*
-* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
-*
-* Contact: 
-* Wooyoung Cho <wooyoung1.cho@samsung.com>
-* Shihyun Kim <shihyun.kim@samsung.com>
-* Taeyoung Son <taeyoung2.son@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.pkg.model;
-
-/**
- * This class describes a data section. It means that a data set is saved in this instance.
- * @author Shihyun Kim <shihyun.kim@samsung.com>
- *
- */
-public class PropertySection {
-       
-       private Properties mProperties;
-       
-       /**
-        * Set Properties instance
-        * @param properties
-        */
-       public void setProperties(Properties properties) {
-               mProperties = properties;
-       }
-       
-       /**
-        * @return Properties instance
-        */
-       public Properties getProperties() {
-               return mProperties;
-       }
-       
-       public String toString() {
-               return "SECTION"+mProperties;
-       }
-}
diff --git a/SdkImageCreator/src/org/tizen/installmanager/pkg/model/Snapshot.java b/SdkImageCreator/src/org/tizen/installmanager/pkg/model/Snapshot.java
deleted file mode 100644 (file)
index 66c20c6..0000000
+++ /dev/null
@@ -1,180 +0,0 @@
-/*
- *  InstallManager
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: 
- * Wooyoung Cho <wooyoung1.cho@samsung.com>
- * Shihyun Kim <shihyun.kim@samsung.com>
- * Taeyoung Son <taeyoung2.son@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.pkg.model;
-
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.List;
-
-import org.tizen.installmanager.lib.Log;
-
-/**
- * This class describes a snapshot.
- * 
- * @author Shihyun Kim <shihyun.kim@samsung.com>
- * 
- */
-public class Snapshot implements Comparable<Snapshot> {
-       private static final String FIELD_TYPE = "type";
-       private static final String FIELD_NAME = "name";
-       private static final String FIELD_PATH = "path";
-       private static final String FIELD_TIME = "time";
-
-       private List<Property> mProperties;
-       
-       /**
-        * Constructor.
-        * 
-        * @param properties
-        *            Set <code>properties</code> to member variable.
-        */
-       public Snapshot(List<Property> properties) {
-               this.mProperties = properties;
-       }
-
-       /**
-        * Get snapshot type.
-        * @return
-        */
-       public String getType() {
-               return getValue(FIELD_TYPE);
-       }
-
-       /**
-        * Get snapshot name.
-        * @return
-        */
-       public String getName() {
-               return getValue(FIELD_NAME);
-       }
-
-       /**
-        * Get snapshot path.
-        * @return
-        */
-       public String getPath() {
-               return getValue(FIELD_PATH);
-       }
-       
-       /**
-        * Get intended date of snapshot
-        * @return
-        */
-       public Date getTime() {
-               String strDate = getValue(FIELD_TIME);
-               SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
-               Date date = null;
-               try {
-                       date = sdf.parse(strDate);
-               } catch (ParseException e) {
-                       Log.err("Snapshot time attribute is not SimpleDateFormat.");
-               }
-               //Date date = new Date(lDate);
-               return date;
-       }
-
-       /**
-        * Get Property instance from configuration key.
-        * 
-        * @param key
-        * @return
-        */
-       private Property getProperty(String key) {
-               for (Property prop : mProperties) {
-                       if (prop.getName().equals(key)) {
-                               return prop;
-                       }
-               }
-               return null;
-       }
-
-       /**
-        * @return List of Property instance.
-        */
-       public List<Property> getProperties() {
-               return mProperties;
-       }
-
-       /**
-        * Set Properties instance to this class.
-        * 
-        * @param properties
-        */
-       public void setProperties(List<Property> properties) {
-               this.mProperties = properties;
-       }
-
-       /**
-        * @param key
-        * @return string value of the property name. empty string if there's no
-        *         such property name
-        */
-       private String getValue(String key) {
-               Property property = getProperty(key);
-               if (property == null) {
-                       return null;
-               } else {
-                       return property.getValue();
-               }
-       }
-       
-       @Override
-       public String toString() {
-               return getName();
-       }
-       
-       @Override
-       public boolean equals(Object arg) {
-               if (arg != null) {
-                       String argName = ((Snapshot)arg).getName();
-                       
-                       if (argName.equals(getName())){
-                               return true;
-                       } else {
-                               return false;
-                       }                       
-               } else {
-                       return false;
-               }
-       }
-
-       @Override
-       public int compareTo(Snapshot snapshot) {
-               //Descending sort.
-               Date argTime = ((Snapshot)snapshot).getTime();
-               return argTime.compareTo(getTime());
-       }
-       
-       @Override
-       public int hashCode() {
-               assert false : "hashCode not designed";
-               return 42; // any arbitrary constant will do
-       }
-}
diff --git a/SdkImageCreator/src/org/tizen/installmanager/pkg/model/SnapshotList.java b/SdkImageCreator/src/org/tizen/installmanager/pkg/model/SnapshotList.java
deleted file mode 100644 (file)
index 815ee74..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-/* 
-*  InstallManager
-*
-* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
-*
-* Contact: 
-* Wooyoung Cho <wooyoung1.cho@samsung.com>
-* Shihyun Kim <shihyun.kim@samsung.com>
-* Taeyoung Son <taeyoung2.son@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.pkg.model;
-
-import java.util.ArrayList;
-
-/**
- * This class describes a snapshot list.
- * 
- * @author Shihyun Kim <shihyun.kim@samsung.com>
- *
- */
-@SuppressWarnings("serial")
-public class SnapshotList extends ArrayList<Snapshot> {
-       public final static SnapshotList EMPTY = new SnapshotList();
-       
-       /**
-        * Finds and returns a snapshot in this list with the same name of the given snapshot.
-        * You have to check the existence with <code>contains()</code> method before calling this method.
-        * @param p0
-        * @return a snapshot that has same name with the given snapshot.
-        * <code>null</code> when cannot find the snapshot 
-        */
-       public Snapshot getSnapshot(Snapshot snapshot) {
-               for(Snapshot s : this) {
-                       if(s.equals(snapshot)) {
-                               return s;
-                       }
-               }
-               return null;
-       }
-       
-       /**
-        * @param snapshot Name
-        * @return snapshot object that has the snapshot name. 
-        * <code>null</code> when cannot find the snapshot
-        */
-       public Snapshot getSnapshotByName(String snapshotName) {
-               for(Snapshot s : this) {
-                       if(s.getName().equals(snapshotName)) {
-                               return s;
-                       }
-               }
-               return null;
-       }
-       
-       public Snapshot getSnapshotByPath(String snapshotPath) {
-               for(Snapshot s : this) {
-                       if(s.getPath().equals(snapshotPath)) {
-                               return s;
-                       }
-               }
-               return null;
-       }
-}
diff --git a/SdkImageCreator/src/org/tizen/installmanager/pkg/model/Version.java b/SdkImageCreator/src/org/tizen/installmanager/pkg/model/Version.java
deleted file mode 100644 (file)
index db29571..0000000
+++ /dev/null
@@ -1,227 +0,0 @@
-/*
-*  InstallManager
-*
-* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
-*
-* Contact: 
-* Wooyoung Cho <wooyoung1.cho@samsung.com>
-* Shihyun Kim <shihyun.kim@samsung.com>
-* Taeyoung Son <taeyoung2.son@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.pkg.model;
-
-import org.tizen.installmanager.core.IMFatalException;
-import org.tizen.installmanager.lib.Log;
-import org.tizen.installmanager.lib.ErrorController.ErrorCode;
-
-
-/**
- * This class represents and manages a version.
- * Version must contains at least one up to three numbers concatenated by periods(.).
- * Namely, (MajorVersion).(MinorVersion).(Revision) 
- * 
- * @author Shihyun Kim <shihyun.kim@samsung.com>
- */
-public class Version {
-
-    public static final int EQ = 0;
-    public static final int LT = -1;
-    public static final int GT = 1;
-
-    private Integer mMajor = 0;
-    private Integer mMinor = 0;
-    private Integer mRevision = 0;
-
-    
-    /**
-     * @param version string representation of version
-     */
-    public Version(String version) {
-        parseVersionString(version);
-    }
-    
-    /**
-     * @param major major version. this cannot be null.
-     * @param minor minor version. this can be null.
-     * @param revision revision. this can be null.
-     */
-    public Version(Integer major, Integer minor, Integer revision) {
-       this.mMajor = major;
-       this.mMinor = minor;
-       this.mRevision = revision;
-    }
-
-    public static Version create(String aVersion) {
-        if (aVersion == null) {
-            return null;
-        }
-        Version version = new Version(aVersion);
-        return version;
-    }
-
-    /**
-     * Seperate major, minor and revision from full version and parsing to Integer. 
-     * @param version full version.
-     */
-    private void parseVersionString(String version) {
-       if (version == null || version.isEmpty()) {
-               return;
-       }
-        String[] dividedVersion = version.split("\\.");
-        int length = dividedVersion.length;
-
-        if (length < 1 || length > 3) {
-               Log.err("Invalid package version: "+version);
-            throw new IMFatalException(ErrorCode.INVALID_PACKAGE_VERSION);
-        }
-
-        try {
-               mMajor = Integer.parseInt(dividedVersion[0]);
-               if(length > 1) {
-                       mMinor = Integer.parseInt(dividedVersion[1]);
-               }
-               if(length > 2) {
-                       mRevision = Integer.parseInt(dividedVersion[2]);
-               }
-        } catch (NumberFormatException numException) {
-                                               Log.err("Invalid package version: "+version);
-                                               throw new IMFatalException(ErrorCode.INVALID_PACKAGE_VERSION);
-        }
-    }
-    
-    /**
-     * @return major version. 
-     */
-    public Integer getMajorVersion() {
-        return mMajor;
-    }
-
-    /**
-     * @return minor version. null means that it's unspecified. 
-     */
-    public Integer getMinorVersion() {
-        return mMinor;
-    }
-
-    /**
-     * @return revision. null means that it's unspecified. 
-     */
-    public Integer getRevision() {
-        return mRevision;
-    }
-    
-    /**
-     * Call compareTo(Version firstVer, Version secondVer) func.   
-     * @param firstVer
-     * @param secondVer
-     * @return
-     */
-    public static int compareVersion(String firstVer, String secondVer){
-       return compareTo(new Version(firstVer), new Version(secondVer));
-    }
-    
-    /**
-     * Compare two versions.
-     * This function compare major version at first and minor version at second and revision at last.
-     * Unspecified version component is considered zero.
-     * @param v1 version 1
-     * @param v2 version 2
-     * @return 0 means equal. negative means v1 is less than v2. 
-     * positive means v1 is greater than v2. 
-     */
-    public static int compareTo(Version v1, Version v2) {
-       int result = Version.EQ;
-       
-       result = compareVersionComponent(v1.getMajorVersion(), v2.getMajorVersion());
-       if (result == Version.EQ) {
-               result = compareVersionComponent(v1.getMinorVersion(), v2.getMinorVersion());
-               if (result == Version.EQ) {
-                       result = compareVersionComponent(v1.getRevision(), v2.getRevision());
-                       return result;
-               }
-       }
-       return result;
-    }
-    
-    /**
-     * Call compareTo(Version this, Version version)
-     * @param version
-     * @return
-     */
-    public int compareTo(Version version) {
-        // return > 0 if this.version > version
-        // return < 0 if this.version < version
-        // return 0 if this.version == version
-       
-        return compareTo(this, version); 
-    }
-    
-    public int compareTo(String version) {
-        // return > 0 if this.version > version
-        // return < 0 if this.version < version
-        // return 0 if this.version == version
-
-       Version ver2 = new Version(version);
-        return compareTo(ver2);
-    }
-    
-    /**
-     * Compare two version components.
-     * null is considered zero.
-     * @param vc1 version component 1
-     * @param vc2 version component 2
-     * @return 0 means equal. negative means vc1 is less than vc2. 
-     * positive means vc1 is greater than vc2. 
-     */
-    private static int compareVersionComponent(Integer vc1, Integer vc2) {
-       if(vc1 == null) {
-               if(vc2 == null) {
-                       return EQ;
-               } else {
-                       return LT;
-               }
-       } else {
-               if(vc2 == null) {
-                       return GT;
-               } else {
-                       if (vc1 > vc2) {
-                       return Version.GT;
-               } else if (vc1 < vc2) {
-                       return Version.LT;
-               } else { 
-                       return Version.EQ;
-               }
-               }
-       }
-    }
-    
-    public String toString() {
-       String version = mMajor.toString();
-       if(mMinor != null) {
-               version = version + "." + mMinor;
-               if(mRevision != null) {
-                       version = version + "." + mRevision;
-               }
-       }
-       return version;
-    }
-    
-}
diff --git a/SdkImageCreator/src/org/tizen/installmanager/ui/InstallManagerWindow.java b/SdkImageCreator/src/org/tizen/installmanager/ui/InstallManagerWindow.java
deleted file mode 100644 (file)
index 0b7b96e..0000000
+++ /dev/null
@@ -1,879 +0,0 @@
-/*
-*  InstallManager
-*
-* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
-*
-* Contact: 
-* Wooyoung Cho <wooyoung1.cho@samsung.com>
-* Shihyun Kim <shihyun.kim@samsung.com>
-* Taeyoung Son <taeyoung2.son@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.ui;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.window.ApplicationWindow;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.StackLayout;
-import org.eclipse.swt.events.PaintEvent;
-import org.eclipse.swt.events.PaintListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.swt.layout.RowData;
-import org.eclipse.swt.layout.RowLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.tizen.installmanager.core.Config;
-import org.tizen.installmanager.core.IMExitException;
-import org.tizen.installmanager.core.InstallManager;
-import org.tizen.installmanager.core.Options;
-import org.tizen.installmanager.core.UpdateInstallManager;
-import org.tizen.installmanager.lib.Documents;
-import org.tizen.installmanager.lib.ErrorController;
-import org.tizen.installmanager.lib.IMError;
-import org.tizen.installmanager.lib.Log;
-import org.tizen.installmanager.lib.Platform;
-import org.tizen.installmanager.lib.ProgramController;
-import org.tizen.installmanager.lib.Registry;
-import org.tizen.installmanager.pkg.lib.PackageManager;
-import org.tizen.installmanager.pkg.model.Package;
-import org.tizen.installmanager.pkg.model.PackageSet;
-import org.tizen.installmanager.ui.dialog.AddExtraRepositoryDialog;
-import org.tizen.installmanager.ui.dialog.IndeterminateProgressDialog;
-import org.tizen.installmanager.ui.dialog.MessageBoxDlg;
-import org.tizen.installmanager.ui.dialog.MessageBoxDlg.DialogType;
-import org.tizen.installmanager.ui.model.Item;
-import org.tizen.installmanager.ui.page.CompletePage;
-import org.tizen.installmanager.ui.page.InstallableListPage;
-import org.tizen.installmanager.ui.page.InstallingPage;
-import org.tizen.installmanager.ui.page.LicensePage;
-import org.tizen.installmanager.ui.page.SetInstallDirectoryPage;
-import org.tizen.installmanager.ui.page.UninstallableListPage;
-import org.tizen.installmanager.ui.page.UninstallingPage;
-import org.tizen.installmanager.ui.page.UpdatableListPage;
-import org.tizen.installmanager.ui.page.ViewController;
-import org.tizen.installmanager.ui.page.WelcomePage;
-import org.tizen.installmanager.ui.page.InstallingPage.InstallProgressMonitor;
-import org.tizen.installmanager.ui.page.WelcomePage.RADIO_ACTION;
-import org.tizen.installmanager.util.PathUtil;
-
-
-/**
- * This class is main class for install manager.
- * @author Taeyoung Son <taeyoung2.son@samsung.com>
- */
-public class InstallManagerWindow extends ApplicationWindow {
-       public static final RGB RGB_BACKGROUND = new RGB(242, 242, 242);
-
-       private static final Point POINT_MAIN_WINDOW = new Point(628, 478);
-       private static Image IMAGE_WINDOW_ICON;
-       private static Color COLOR_BACKGROUND;
-
-       private static InstallManagerWindow window;
-
-       private StackLayout sl_composite = new StackLayout();
-       private static Button btnClose;
-       private static Button btnBack;
-       private static Button btnNext;
-       private static Button addExtraButton;
-
-       private AddExtraRepositoryDialog extraDialog = null;
-       
-       private Composite pageComposite;
-       private WelcomePage compositeWelcomePage;
-       private LicensePage compositeLicensePage;
-       private InstallableListPage compositeInstallablePage;
-       private UninstallableListPage compositeUninstallablePage;
-       private InstallingPage compositeInstallingPage;
-       private UninstallingPage compositeUninstallingPage;
-       private CompletePage compositeCompletePage;
-       private SetInstallDirectoryPage compositeSetInstallDirectoryPage;
-       public UpdatableListPage compositeUpdatableListPage;
-
-       private static ViewController controller;
-       private SelectionAdapter cancelBtnSelectionAdapter = null;
-       private SelectionAdapter closeBtnSelectionAdapter = null;
-       protected boolean cancelButtonClicked;
-
-       /**
-        * Create the application window.
-        */
-       public InstallManagerWindow() {
-               super(null);
-               setShellStyle(SWT.BORDER | SWT.TITLE);
-       }
-
-       /**
-        * Get installmanager window background color.
-        * @return background color
-        */
-       public static Color getBackgroundColor() {
-               if (COLOR_BACKGROUND == null) {
-                       COLOR_BACKGROUND = new Color(null, RGB_BACKGROUND);
-               }
-               return COLOR_BACKGROUND;
-       }
-
-       private static Image getWindowIconImage() {
-               if (IMAGE_WINDOW_ICON == null) {
-                       IMAGE_WINDOW_ICON = PathUtil.getImageFromResource("/res/icons/SDK_icon.png");
-               }
-               return IMAGE_WINDOW_ICON;
-       }
-
-       private void init() throws IMExitException{
-               Log.log("Window init start");
-               
-               //make waiting dialog.
-               final IndeterminateProgressDialog progressbar = IndeterminateProgressDialog.getInstance();
-               
-               final Shell shell = progressbar.getParent();
-               shell.getDisplay().asyncExec(new Runnable(){
-                       public void run() {
-                               //checking installmanager update.
-                               if (Options.doUpdateInstallManager) {
-                                       progressbar.updateName("Checking InstallManager update.\nIt may take a minute...");
-                                       shell.getDisplay().asyncExec(new Runnable() {
-                                               public void run() {
-                                                       if (updateInstallManager()) {
-                                                               Log.log("InstallManager is updatable.");
-                                                               System.out.println("## Success to update the InstallManager, and restart now.");
-                                                               ErrorController.isInstallManagerUpdatable = true;
-                                                               return;
-                                                       }
-                                               }
-                                       });
-                               } else {}
-                               
-                               //initialize installmanager
-                               progressbar.updateName("Connecting to package server.\nIt may take a minute...");
-                               shell.getDisplay().asyncExec(new Runnable() {
-                                       public void run() {
-                                               if (!initInstallManager()) {
-                                                       Log.err("InstallManager init fail.");
-                                                       ErrorController.setInstallationSuccess(false);
-                                               }
-                                       }
-                                       
-                               });
-                               
-                               //init end
-                               progressbar.finish();
-                       }
-               });
-               
-               if (!shell.isDisposed()) {
-                       progressbar.open();
-               }
-               
-               if (ErrorController.isInstallManagerUpdatable) {
-                       throw new IMExitException(Config.EXITCODE_HAS_SELF_UPDATE);
-               }
-
-               Log.log("Window init end");
-       }
-       
-       private boolean updateInstallManager() {
-               UpdateInstallManager upInstaller = new UpdateInstallManager();
-               
-               return upInstaller.update();
-               
-       }
-       
-       /**
-        * init IM's configuation and packages information.
-        * @return
-        */
-       private boolean initInstallManager() {
-               ErrorController.setInstallationSuccess(true);
-               
-               controller = new ViewController();
-               boolean bResult = controller.init();
-               
-               return bResult;
-       }
-
-       /**
-        * Create contents of the application window.
-        * 
-        * @param parent
-        */
-       @Override
-       protected Control createContents(Composite parent) {
-               
-               IMError.setComposite(parent);
-               Composite container = new Composite(parent, SWT.NONE);
-               container.setBackground(getBackgroundColor());
-               RowLayout rl_container = new RowLayout(SWT.VERTICAL);
-               rl_container.spacing = 0;
-               rl_container.marginTop = 0;
-               rl_container.marginRight = 0;
-               rl_container.marginLeft = 0;
-               rl_container.marginBottom = 0;
-               container.setLayout(rl_container);
-
-               pageComposite = new Composite(container, SWT.NONE);
-               pageComposite.setLayoutData(new RowData(619, 395));
-               pageComposite.setLayout(sl_composite);
-               pageComposite.setBackground(InstallManagerWindow.getBackgroundColor());
-
-               Composite composite_1 = new Composite(container, SWT.NONE);
-               composite_1.setLayoutData(new RowData(619, 38));
-               composite_1.setBackground(InstallManagerWindow.getBackgroundColor());
-
-               Label label = new Label(composite_1, SWT.SEPARATOR | SWT.HORIZONTAL);
-               label.setBounds(0, 0, 620, 2);
-
-               btnClose = new Button(composite_1, SWT.NONE);
-               btnClose.setText("Cancel");
-               cancelBtnSelectionAdapter = new SelectionAdapter() {
-                       @Override
-                       public void widgetSelected(SelectionEvent e) {
-                               int result = MessageBoxDlg.NO;
-                               if (sl_composite.topControl == compositeInstallingPage) {
-                                       InstallProgressMonitor mon = compositeInstallingPage.getInstallProgressMonitor();
-                                       mon.setCancelRequested(true);
-                                       result = MessageBoxDlg.showDlg(
-                                                       e.display.getActiveShell(),
-                                                       "Tizen SDK Install Manager",
-                                                       "Are you sure you want to quit Install Manager?\n\nIf you click \"Yes\", the installation is stopped.",
-                                                       DialogType.WARNING, false);
-                                       if (result == MessageBoxDlg.YES) {
-                                               mon.setCanceled(true);
-                                       } else {
-                                               mon.setCancelRequested(false);
-                                       }
-                                       return;
-                               } else if (sl_composite.topControl == compositeUninstallingPage) {
-                                       result = MessageBoxDlg.showDlg(
-                                                       e.display.getActiveShell(),
-                                                       "Tizen SDK Install Manager",
-                                                       "Are you sure to quit Install Manager?\n\nIf you click \"Yes\", the uninstallation is stopped.",
-                                                       DialogType.WARNING, false);
-                               } else if (sl_composite.topControl == compositeCompletePage) {
-                                       if (Documents.isChecked()) {
-                                               Documents.showChangeLog(); // show the change log(history)
-                                       }
-                                       result = MessageBoxDlg.YES;
-                               }
-                               else
-                                       result = MessageBoxDlg.showDlg(e.display.getActiveShell(),
-                                                       "Tizen SDK Install Manager",
-                                                       "Are you sure to quit Install Manager?",
-                                                       DialogType.WARNING, false);
-                               if (result == MessageBoxDlg.YES) {
-                                       e.display.close();
-                               }
-                       }
-               };
-               
-               closeBtnSelectionAdapter = new SelectionAdapter() {
-                       @Override
-                       public void widgetSelected(SelectionEvent arg0) {
-                               arg0.display.close();
-                       }
-               };
-               
-               btnClose.addSelectionListener(cancelBtnSelectionAdapter);
-               btnClose.setBounds(531, 10, 78, 29);
-
-               btnNext = new Button(composite_1, SWT.NONE);
-               btnNext.setText("Next");
-               btnNext.addSelectionListener(new SelectionAdapter() {
-                       @Override
-                       public void widgetSelected(SelectionEvent e) {
-                               if (sl_composite.topControl == compositeWelcomePage) {
-                                       addExtraButton.setVisible(false);
-                                       if (compositeWelcomePage.getSelectedRadioButton() == RADIO_ACTION.INSTALL) {
-                                               if (!ErrorController.checkInstallationSuccess())
-                                                       return;
-                                               btnNext.setEnabled(compositeLicensePage.getAcceptButton()
-                                                                                                                               .getSelection());
-                                               if (controller.existRemovablePackage()) // Update case
-                                               {
-                                                       boolean hasItem = false;
-
-                                                       hasItem = compositeUpdatableListPage.loadPage(controller);
-                                                       btnBack.setVisible(true);
-                                                       addExtraButton.setVisible(true);
-
-                                                       if (hasItem) {
-                                                               showComposite(compositeUpdatableListPage);
-                                                               if (controller.existRemovablePackage()) {
-                                                                       btnNext.setText("Install");
-                                                               }
-                                                               btnBack.setVisible(true);
-                                                       } else {
-                                                               btnBack.setVisible(false);
-                                                               btnNext.setVisible(false);
-                                                       }
-                                               } else {
-                                                       showComposite(compositeLicensePage);
-                                                       btnBack.setVisible(true);
-                                               }
-                                       } else if (compositeWelcomePage.getSelectedRadioButton() == RADIO_ACTION.UNINSTALL) {
-                                               int resultDialog = MessageBoxDlg.NO;
-                                               resultDialog = MessageBoxDlg.showDlg(
-                                                               e.display.getActiveShell(),
-                                                               "Tizen SDK Install Manager",
-                                                               "Are you sure you want to remove the Tizen SDK?\n\nIf you click \"Yes\", the Tizen SDK is uninstalled.",
-                                                               DialogType.WARNING, false);
-                                               if (resultDialog == MessageBoxDlg.YES) {
-                                                       showComposite(compositeUninstallingPage);
-                                                       btnBack.setVisible(false);
-                                                       btnNext.setVisible(false);
-                                                       btnClose.setEnabled(false);
-                                                       addExtraButton.setVisible(false);
-                                                       List<Item> items = compositeUninstallablePage.getItems();
-                                                       boolean result = compositeUninstallingPage.loadPage(getSelectedPackageNames(items) /* compositeInstallablePage.getCheckedPackageNames()*/,
-                                                                                                                                                               controller,
-                                                                                                                                                               window);
-                                                       if (!result) {
-                                                               showComposite(compositeWelcomePage);
-                                                               btnBack.setVisible(true);
-                                                               btnNext.setVisible(true);
-                                                               btnClose.setEnabled(true);
-                                                       }
-                                               } else {
-                                                       return;
-                                               }
-                                       }
-                               } else if (sl_composite.topControl == compositeLicensePage) {
-                                       boolean hasItem = compositeInstallablePage.loadPage(controller);
-                                       if (hasItem) {
-                                               showComposite(compositeInstallablePage);
-                                               btnNext.setEnabled(hasItem);
-                                               btnBack.setVisible(hasItem);
-                                               addExtraButton.setVisible(true);
-                                               if (controller.existRemovablePackage()) {
-                                                       btnNext.setText("Install");
-                                               }
-                                       } else {
-                                               //                      btnNext.setVisible(false);
-                                               //                        MessageBoxDlg.showDlg(Display.getCurrent().getShells()[0],
-                                               //                                              "Information",
-                                               //                                              "There is nothing to update.",
-                                               //                                              DialogType.NOTIFY);
-                                       }
-                               } else if (sl_composite.topControl == compositeInstallablePage) {
-                                       List<Item> items = compositeInstallablePage.getItems();
-                                       if (getSelectedPackageNames(items).size() <= 0) {
-                                               return;
-                                       }
-                                       if (controller.existRemovablePackage()) {
-                                               btnBack.setVisible(false);
-                                               btnNext.setVisible(false);
-                                               showComposite(compositeInstallingPage);
-                                               addExtraButton.setVisible(false);
-                                               boolean result = compositeInstallingPage.loadPage(getSelectedPackageNames(items),
-                                                                                                                                                       controller,
-                                                                                                                                                       Registry.getInstalledPath(),
-                                                                                                                                                       window, true);
-                                               if (!result) {
-                                                       showComposite(compositeInstallablePage);
-                                                       btnBack.setVisible(true);
-                                                       btnNext.setVisible(true);
-                                                       btnClose.setEnabled(true);
-                                                       addExtraButton.setVisible(true);
-                                               }
-                                       } else {
-                                               showComposite(compositeSetInstallDirectoryPage);
-                                               compositeSetInstallDirectoryPage.loadPage(
-                                                               controller,
-                                                                                                                                       compositeInstallablePage.getCheckedPackageSize());
-                                               btnNext.setText("Install");
-                                               addExtraButton.setVisible(false);
-                                       }
-                               } else if (sl_composite.topControl == compositeUpdatableListPage) {
-                                       List<Item> items = compositeUpdatableListPage.getItems();
-                                       if (getSelectedPackageNames(items).size() <= 0) {
-                                               return;
-                                       }
-                                       if (controller.existRemovablePackage()) {
-                                               btnBack.setVisible(false);
-                                               btnNext.setVisible(false);
-                                               addExtraButton.setVisible(false);
-                                               showComposite(compositeInstallingPage);
-                                               boolean result = compositeInstallingPage.loadPage(getSelectedPackageNames(items), controller, Registry.getInstalledPath(), window, true);
-                                               
-                                               if (!result) {
-                                                       showComposite(compositeUpdatableListPage);
-                                                       btnBack.setVisible(true);
-                                                       btnNext.setVisible(true);
-                                                       btnClose.setEnabled(true);
-                                                       addExtraButton.setVisible(true);
-                                               }
-                                       } else {
-                                               showComposite(compositeSetInstallDirectoryPage);
-                                               compositeSetInstallDirectoryPage.loadPage(controller, compositeInstallablePage.getCheckedPackageSize());
-                                               btnNext.setText("Install");
-                                       }
-                               } else if (sl_composite.topControl == compositeSetInstallDirectoryPage) {
-                                       boolean installable = compositeSetInstallDirectoryPage.isInstallablePath();
-                                       if (!installable) {
-                                               MessageBoxDlg.showDlg(
-                                                               Display.getCurrent().getShells()[0],
-                                                                                               "Error",
-                                                                                               "Not enough disk space for the installation. Select a different installation path.",
-                                                                                               DialogType.ERROR, false);
-                                               return;
-                                       }
-                                       btnBack.setVisible(false);
-                                       btnNext.setVisible(false);
-                                       addExtraButton.setVisible(false);
-                                       List<Item> items = compositeInstallablePage.getItems();
-                                       showComposite(compositeInstallingPage);
-                                       boolean result = compositeInstallingPage.loadPage(
-                                                       getSelectedPackageNames(items),
-                                                                                                                                               controller,
-                                                                                                                                               compositeSetInstallDirectoryPage.getInstallPath(),
-                                                                                                                                               window, false);
-                                       if (!result) {
-                                               showComposite(compositeInstallablePage);
-                                               btnBack.setVisible(true);
-                                               btnNext.setVisible(true);
-                                               btnClose.setEnabled(true);
-                                       }
-                               } else if (sl_composite.topControl == compositeUninstallablePage) {
-                                       showComposite(compositeUninstallingPage);
-                                       btnBack.setVisible(false);
-                                       btnNext.setVisible(false);
-                                       btnClose.setEnabled(false);
-                                       addExtraButton.setVisible(false);
-                                       List<Item> items = compositeUninstallablePage.getItems();
-                                       boolean result = compositeUninstallingPage.loadPage(getSelectedPackageNames(items) /* compositeInstallablePage.getCheckedPackageNames()*/,
-                                                                                                                                               controller,
-                                                                                                                                               window);
-                                       if (!result) {
-                                               showComposite(compositeUninstallablePage);
-                                               btnBack.setVisible(true);
-                                               btnNext.setVisible(true);
-                                               btnClose.setEnabled(true);
-                                       }
-                               }
-                       }
-               });
-               btnNext.setBounds(447, 10, 78, 29);
-
-               btnBack = new Button(composite_1, SWT.NONE);
-               btnBack.addSelectionListener(new SelectionAdapter() {
-                       @Override
-                       public void widgetSelected(SelectionEvent e) {
-                               if (sl_composite.topControl == compositeLicensePage) {
-                                       btnNext.setEnabled(true);
-                                       btnBack.setVisible(false);
-                                       btnNext.setFocus();
-                                       addExtraButton.setVisible(false);
-                                       showComposite(compositeWelcomePage);
-                               } else if (sl_composite.topControl == compositeInstallablePage || sl_composite.topControl == compositeUpdatableListPage) {
-                                       compositeInstallablePage.getItems().clear();
-                                       addExtraButton.setVisible(false);
-                                       if (controller.existRemovablePackage()) {
-                                               btnBack.setVisible(false);
-                                               showComposite(compositeWelcomePage);
-                                       } else {
-                                               showComposite(compositeLicensePage);
-                                       }
-                                       btnNext.setEnabled(true);
-                                       btnNext.setText("Next");
-                               } else if (sl_composite.topControl == compositeSetInstallDirectoryPage) {
-                                       showComposite(compositeInstallablePage);
-                                       addExtraButton.setVisible(true);
-                                       btnNext.setText("Next");
-                                       btnNext.setEnabled(true);
-                               } else if (sl_composite.topControl == compositeUninstallablePage) {
-                                       showComposite(compositeWelcomePage);
-                                       addExtraButton.setVisible(false);
-                                       btnNext.setText("Next");
-                                       btnNext.setEnabled(true);
-                                       btnBack.setVisible(false);
-                               }
-                       }
-               });
-               btnBack.setBounds(363, 10, 78, 29);
-               btnBack.setText("Back");
-               btnBack.setVisible(false);
-               
-               setAddRepositoryButton(composite_1);
-
-               compositeWelcomePage = new WelcomePage(pageComposite, SWT.NONE);
-               compositeLicensePage = new LicensePage(pageComposite, SWT.NONE);
-               compositeCompletePage = new CompletePage(pageComposite, SWT.NONE);
-               compositeInstallingPage = new InstallingPage(pageComposite, SWT.NONE);
-               compositeInstallablePage = new InstallableListPage(pageComposite, SWT.NONE);
-               compositeUninstallingPage = new UninstallingPage(pageComposite, SWT.NONE);
-               compositeUninstallablePage = new UninstallableListPage(pageComposite, SWT.NONE);
-               compositeSetInstallDirectoryPage = new SetInstallDirectoryPage(pageComposite, SWT.NONE);
-               compositeUpdatableListPage = new UpdatableListPage(pageComposite, SWT.NONE);
-
-               registLicensePageListener();
-               registCompletePageListener();
-
-               initWelcomePage();
-               
-               return container;
-       }
-       
-       /**
-        * Set add Repository button. 
-        */
-       private void setAddRepositoryButton(final Composite composite) {
-               if (addExtraButton == null) {
-                       addExtraButton = new Button(composite ,SWT.NONE);                       
-               }
-
-               addExtraButton.setBounds(20, 10, 125, 29);
-               addExtraButton.setText("Add Repository");
-               addExtraButton.setVisible(false);
-               
-               addExtraButton.addSelectionListener(new SelectionAdapter() {
-                       public void widgetSelected(SelectionEvent e) {
-                               extraDialog = new AddExtraRepositoryDialog(composite.getShell());
-                               int ret = extraDialog.open();
-                               
-                               if (ret != 0) {
-                                       Log.err("Cannot open extra dialog");
-                               } else {
-                                       if (sl_composite.topControl == compositeInstallablePage) {
-                                               compositeInstallablePage.addExtensionPackagesToExtra(extraDialog.getPackagesFromExtraRepository());
-                                       } else if (sl_composite.topControl == compositeUpdatableListPage) {
-                                               compositeUpdatableListPage.addExtensionPackagesToExtra(extraDialog.getPackagesFromExtraRepository());
-                                       }
-                               }
-                       }
-               });
-       }
-       
-       private void initWelcomePage() {
-               compositeWelcomePage.setViewController(controller);
-               
-               if (ErrorController.checkInstallationSuccess()) {
-                       compositeWelcomePage.setTitle(WelcomePage.STRING_TITLE);
-                       compositeWelcomePage.setSubTitleBounds(20, 190, 600, 40);
-                       compositeWelcomePage.setSubTitle(WelcomePage.STRING_SUBTITLE);
-                       
-                       compositeWelcomePage.setVisibleRadioButton(true);
-                       btnNext.setVisible(true);
-                       btnClose.setText("Cancel");
-                       
-                       btnClose.removeSelectionListener(closeBtnSelectionAdapter);
-                       btnClose.removeSelectionListener(cancelBtnSelectionAdapter);
-                       btnClose.addSelectionListener(cancelBtnSelectionAdapter);
-                       
-                       compositeWelcomePage.setButtonStatus();
-               } else {
-                       compositeWelcomePage.setVisibleRadioButton(false);
-                       btnNext.setVisible(false);
-                       
-                       compositeWelcomePage.setTitle("Cannot start Tizen SDK Install Manager.");
-                       
-                       String errMsg = ErrorController.getErrorMessage();
-                       String repository = Config.getInstance().getConfigFile().getRepository();
-                       errMsg = errMsg + "\n(" + repository + ")";
-                       compositeWelcomePage.setSubTitleBounds(20, 190, 600, 100);
-                       compositeWelcomePage.setErrorSubTitle(errMsg);
-
-                       btnClose.setText("Close");
-                       
-                       btnClose.removeSelectionListener(closeBtnSelectionAdapter);
-                       btnClose.removeSelectionListener(cancelBtnSelectionAdapter);
-                       btnClose.addSelectionListener(closeBtnSelectionAdapter);
-               }
-               btnNext.setFocus();
-               sl_composite.topControl = compositeWelcomePage;
-       }
-       
-       /**
-        * Refresh InstallManager. 
-        * Refresh packages and configuration information.
-        */
-       public void refresh() {
-               initInstallManager();   
-               initWelcomePage();
-       }
-
-       /**
-        * Checks if there's updatable meta package.
-        * Then print "updatable" to stdout.
-        */
-       private static void checkMetaPackageUpdate() {
-               if (PackageManager.getInstance().getUpdatableMetaPackages().size() != 0) {
-                       System.out.println("updatable");
-               }
-       }
-       
-       /**
-        * There is no UI, just download packages.
-        * @throws IMExitException
-        */
-       private static void onlyDownloadPackages() throws IMExitException {
-               ViewController controller = new ViewController();
-               controller.init();
-
-               InstallManager installManager = InstallManager.getInstance();
-               PackageManager packageManager = installManager.getPackageManager();
-               
-               // Get all meta packages list by boundary.(eg. public, partner, all....) 
-               PackageSet filteredMeta = filterPackageSet();
-               PackageSet downloadablePkgs = packageManager.getDependsPackagesFromRepository(filteredMeta);
-               
-               // Download all meta packages. 
-               boolean filteredPackages = installManager.downloadPackages(downloadablePkgs, null);
-               
-               if (filteredPackages) {
-                       Log.log("Success to download packages from repository");
-               } else {
-                       Log.err("Fail to download packages from repository");
-                       return;
-               }
-       }
-       
-       private static PackageSet filterPackageSet() {
-               PackageManager pm = PackageManager.getInstance();
-               
-               PackageSet downloadPackageList = pm.getLeafMetaPackages();
-               
-               String boundary = Options.boundary;
-               if (boundary.equalsIgnoreCase("public")) {
-                       PackageSet partnerMetaPackages = pm.getPartnerMetaPackages();
-                       
-                       if (!partnerMetaPackages.isEmpty()) {
-                               downloadPackageList.removeAll(partnerMetaPackages);
-                       }
-               } else if (boundary.equalsIgnoreCase("partner")) {
-                       PackageSet publicMetaPackages = pm.getPublicMetaPackages();
-                       
-                       if (!publicMetaPackages.isEmpty()) {
-                               downloadPackageList.removeAll(publicMetaPackages);
-                       }
-               }
-               
-               return downloadPackageList;
-       }
-       
-       private static void showInstallManagerVersion() {
-               System.out.println("InstallManager Version : " + 
-                               Config.getInstance().getInstallManagerVersion().toString());
-       }
-       
-       /**
-        * Launch the application.
-        * 
-        * @param args
-        */
-       public static void main(String args[]) {
-               InstallManager.deleteTempFile();
-               Log.open();
-               try {
-                       Log.LogTitle("Installmanager start");
-                       Log.log(Platform.getPlatformInfo());
-                       Log.log("Install Manager Jar Build-Version: " + Config.getJarBuildVersion());
-                       Options.loadCmdArgs(args);
-                       
-                       if (Options.onlyDownload) {
-                               onlyDownloadPackages();
-                               System.exit(0);
-                       } else if (Options.showVersion) {
-                               showInstallManagerVersion();
-                               System.exit(0);
-                       }
-                       window = new InstallManagerWindow();
-                       window.setBlockOnOpen(true);
-                       
-                       window.init();
-                       
-                       Log.log("after init");
-                       if (Options.checkPackageUpdate) {
-                               checkMetaPackageUpdate();
-                       } else if (Options.printDepGraph) {
-                               InstallManager.getInstance().getPackageManager().printDepGraph();
-                       } else {
-                               window.open();
-                               if (Display.getCurrent() != null
-                                               && !Display.getCurrent().isDisposed()) {
-                                       Display.getCurrent().dispose();
-                               }
-                       }
-               } catch (IMExitException e) {
-                       // do not remove sdk temp dir if exit for self update
-                       if (ErrorController.getExitCode() == Config.EXITCODE_HAS_SELF_UPDATE) {
-                               Options.doRemoveTempTizenSDK = false;
-                       }
-                       
-                       Log.log("Gracefully exit");
-               } catch (Throwable e) {
-                       Log.err("Unexpected error occurred");
-                       Log.ExceptionLog(e);
-                       
-                       // show error message
-                       if (window != null) {
-                               window.open();
-                               
-                               if (Display.getCurrent() != null
-                                               && !Display.getCurrent().isDisposed()) {
-                                       Display.getCurrent().dispose();
-                               }
-                       }
-                       
-                       ErrorController.setExitCode(Config.EXITCODE_UNKNOWN_ERROR);
-               } finally {
-                       if (Platform.isWindows()) {
-                               ProgramController.createProgramController().removeSDKTempDir();
-                       }
-                       
-                       Log.LogTitle("Installmanager finish");
-                       Log.close();
-                       
-                       if (ErrorController.getExitCode() != Config.EXITCODE_NORMAL){ 
-                               System.exit(ErrorController.getExitCode());
-                       }
-               }
-       }
-
-       @Override
-       protected void configureShell(Shell newShell) {
-               newShell.setBackground(getBackgroundColor());
-               newShell.setMinimumSize(getInitialSize());
-               newShell.setSize(getInitialSize());
-               newShell.setImage(getWindowIconImage());
-               super.configureShell(newShell);
-
-               newShell.setText("Tizen SDK Install Manager");
-       }
-
-       @Override
-       /**
-        * Install manager window is close.
-        */
-       public boolean close() {
-               return false;
-       }
-
-       /**
-        * Return the initial size of the window.
-        */
-       @Override
-       protected Point getInitialSize() {
-               return POINT_MAIN_WINDOW;
-       }
-
-       /**
-        * Show the composite depending on parameter.
-        * @param composite
-        */
-       public void showComposite(Composite composite) {
-               StackLayout layout;
-               if (composite.getParent().getLayout() instanceof StackLayout) {
-                       layout = (StackLayout) composite.getParent().getLayout();
-                       layout.topControl = composite;
-               }
-               composite.getParent().layout();
-       }
-
-       private void registLicensePageListener() {
-               compositeLicensePage.getAcceptButton()
-                                                       .addSelectionListener(new SelectionAdapter() {
-
-                                                               @Override
-                                                               public void widgetSelected(SelectionEvent e) {
-                                                                       btnNext.setEnabled(compositeLicensePage.getAcceptButton()
-                                                                                                                                                       .getSelection());
-                                                               }
-                                                       });
-       }
-
-       private void registCompletePageListener() {
-               compositeCompletePage.addPaintListener(new PaintListener() {
-
-                       @Override
-                       public void paintControl(PaintEvent arg0) {
-                               btnClose.setText("Close");
-                       }
-               });
-       }
-
-       /**
-        * Get selected package names on installing
-        * @param items
-        * @return list of selected package names.
-        */
-       public List<String> getSelectedPackageNames(List<Item> items) {
-               List<String> list = new ArrayList<String>();
-               for (int i = 0; i < items.size(); i++) {
-                       items.get(i).getTerminalPackages(list, true);
-               }
-
-               return list;
-       }
-       
-       /**
-        * Get install manager window object.
-        * @return install manager window object.
-        */
-       public static InstallManagerWindow getInstallManagerWindow() {
-               return window;
-       }
-
-       /**
-        * Get complete page composite object
-        * @return complete page composite object
-        */
-       public CompletePage getCompletePage() {
-               return compositeCompletePage;
-       }
-
-       /**
-        * If parameter is true, 'Next' button will be enabled. but false, 'Next' button will be disabled.
-        * @param enabled
-        */
-       public static void setNextBtnEnabled(boolean enabled) {
-               btnNext.setEnabled(enabled);
-       }
-
-       /**
-        * If parameter is true, 'Back' button will be enabled. but false, 'Back' button will be disabled.
-        * @param enabled
-        */
-       public static void setBackBtnEnabled(boolean enabled) {
-               btnBack.setEnabled(enabled);
-       }
-
-       /**
-        * If parameter is true, 'Cancel' button will be enabled. but false, 'Cancel' button will be disabled.
-        * @param enabled
-        */
-       public void setCancelBtnEnabled(boolean enabled) {
-               btnClose.setEnabled(enabled);
-       }
-       
-       public ViewController getViewController() {
-               return controller;
-       }
-}
diff --git a/SdkImageCreator/src/org/tizen/installmanager/ui/dialog/AddExtraDialog.java b/SdkImageCreator/src/org/tizen/installmanager/ui/dialog/AddExtraDialog.java
deleted file mode 100644 (file)
index 2884395..0000000
+++ /dev/null
@@ -1,256 +0,0 @@
-/*
- *  InstallManager
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: 
- * Wooyoung Cho <wooyoung1.cho@samsung.com>
- * Shihyun Kim <shihyun.kim@samsung.com>
- * Taeyoung Son <taeyoung2.son@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.ui.dialog;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.tizen.installmanager.core.SDKExtensionInfo;
-import org.tizen.installmanager.lib.Downloader;
-import org.tizen.installmanager.lib.ErrorController;
-import org.tizen.installmanager.lib.ErrorController.ErrorCode;
-import org.tizen.installmanager.pkg.lib.PackageManager;
-import org.tizen.installmanager.util.PathUtil;
-
-/**
- * This class supports to add extra's repository.
- * 
- * @author Yongsung Kim <yongsung1.kim@samsung.com>
- */
-public class AddExtraDialog extends Dialog {
-       private String DIALOG_TITLE = "Add Repository";
-       private AddExtraRepositoryDialog rDialog = null;
-       
-       private Text nameText = null;
-       private Text repositoryText = null;
-       
-       private Label errLabel = null;
-       private Button okButton;
-       
-       private String thirdPartyName = "";
-       private String thirdPartyRepository = "";
-
-       public AddExtraDialog(Shell parentShell) {
-               super(parentShell);
-               setShellStyle(SWT.BORDER | SWT.TITLE | SWT.APPLICATION_MODAL);
-       }
-       
-       /**
-        * Return the initial size of the dialog.
-        */
-       @Override
-       protected Point getInitialSize() {
-               return new Point(400, 195);
-       }
-       
-       /**
-        * Set to enable OK button.
-        * 
-        * @param isAvailable
-        */
-       public void okButtonEnable(boolean isAvailable) {
-               okButton = getButton(Window.OK);
-               okButton.setEnabled(isAvailable);
-       }
-       
-       /**
-        * Create contents of the dialog.
-        * 
-        * @param parent
-        */
-       @Override
-       protected Control createDialogArea(Composite parent) {
-               Composite container = (Composite) super.createDialogArea(parent);
-               container.setLayout(null);
-               container.getShell().setImage(PathUtil.getImageFromResource("/res/icons/SDK_icon.png"));
-               rDialog = new AddExtraRepositoryDialog(getParentShell());
-               
-               setTitle();
-               
-               setNameText(container);
-               setRepositoryText(container);
-               setErrorLabel(container);
-               setSeparator(container);
-               
-               return container;
-       }
-       
-       private void setTitle() {
-               getShell().setText(DIALOG_TITLE);
-       }
-       
-       @Override
-       protected void okPressed() {
-               thirdPartyName = nameText.getText();
-               thirdPartyRepository = repositoryText.getText();
-               if (!isValidName()) {
-                       errLabel.setText(ErrorController.getErrorMessage());
-               } else if (!isOverlapRepository()) {
-                       errLabel.setText(ErrorController.getErrorMessage());
-               } else if (!isValidRepository()) {
-                       errLabel.setText(ErrorController.getErrorMessage());
-               } else {
-                       this.close();
-               }
-       }
-       
-       private void setNameText(Composite composite) {
-               Label nameLabel = new Label(composite, SWT.NONE);
-               if (nameText == null) {
-                       nameText = new Text(composite, SWT.BORDER);
-               }
-               nameLabel.setBounds(5, 7, 75, 23);
-               nameLabel.setText("Name :");
-               nameText.setBounds(85, 5, 305, 23);
-       }
-       
-       private void setRepositoryText(Composite composite) {
-               Label repositoryLabel = new Label(composite, SWT.NONE);
-               if (repositoryText == null) {
-                       repositoryText = new Text(composite, SWT.BORDER);
-               }
-               repositoryLabel.setBounds(5, 34, 75, 23);
-               repositoryLabel.setText("Repository :");
-               repositoryText.setBounds(85, 32, 305, 23);
-               repositoryText.append("http://");
-       }
-       
-       private void setErrorLabel(Composite composite) {
-               if (errLabel == null) {
-                       errLabel = new Label(composite, SWT.WRAP);
-               }
-               
-               errLabel.setBounds(5, 60, 380, 50);
-               errLabel.setForeground(new Color(null, 255, 0, 0));
-               errLabel.setEnabled(true);
-       }
-       
-       private void setSeparator(Composite composite) {
-               Label sep = new Label(composite, SWT.SEPARATOR | SWT.HORIZONTAL);
-               sep.setBounds(0, 115, 400, 1);
-       }
-       
-       private boolean isValidName() {
-               if (!hasSpaceInName()) {
-                       return false;
-               } else if (isOnlyEngName()) {
-                       return true;
-               } else {
-                       return false;
-               }
-       }
-       
-       private boolean isOnlyEngName() {
-               char[] temp = thirdPartyName.toCharArray();
-               int tmp = Character.getType(temp[0]);
-               if (tmp == 5) {
-                       ErrorController.setError(ErrorCode.HANGUL_IN_REPOSITORY_NAME);
-                       return false;
-               } else {
-                       return true;
-               }
-       }
-       
-       private boolean hasSpaceInName() {
-               if (thirdPartyName.length() <= 0) {
-                       ErrorController.setError(ErrorCode.SPACE_IN_REPOSITORY_NAME);
-                       return false;
-               } else {
-                       for (int i = 0; i < thirdPartyName.length(); i++) {
-                               if (thirdPartyName.charAt(i) == ' ') {
-                                       ErrorController.setError(ErrorCode.SPACE_IN_REPOSITORY_NAME);
-                                       return false;
-                               }
-                       }
-               }
-
-               return true;
-       }
-       
-       private boolean isValidRepository() {
-               URL serverUrl;
-               
-               try {
-                       serverUrl = new URL(PathUtil.addURLPath(thirdPartyRepository, 
-                                                   PackageManager.getInstance().getPackageListFileName()));
-                       
-                       Downloader downloader = new Downloader();
-                       boolean conResult = downloader.connect(serverUrl);
-                       
-                       return conResult;
-                       
-               } catch (MalformedURLException e) {
-                       // the URL is not in a valid form
-                       ErrorController.setError(ErrorCode.WRONG_URL_FORMAT);
-                       return false;
-               }
-       }
-       
-       private boolean isOverlapRepository() {
-               removeSeperator();
-               SDKExtensionInfo extensionInfo = rDialog.getSdkExtensionInfo();
-               if (extensionInfo.contains(thirdPartyRepository)) {
-                       ErrorController.setError(ErrorCode.OVERLAP_EXTENSION_REPOSITORY);
-                       return false;
-               } else if (extensionInfo.containsBuiltIn(thirdPartyRepository)) {
-                       ErrorController.setError(ErrorCode.OVERLAP_BUILT_IN_EXTENSION_REPOSITORY);
-                       return false;
-               } else {
-                       return true;
-               }
-       }
-       
-       private void removeSeperator() {
-               if (thirdPartyRepository.endsWith(PathUtil.URL_SEPERATOR)) {
-                       while (thirdPartyRepository.endsWith(PathUtil.URL_SEPERATOR)) {
-                               thirdPartyRepository = thirdPartyRepository.substring(0, thirdPartyRepository.length() - 1);
-                       }
-               }
-       }
-       
-       public String getThirdPartyName() {
-               return thirdPartyName;
-       }
-       
-       public String getThirdPartyRepository() {
-               removeSeperator();
-               return thirdPartyRepository;
-       }
-}
diff --git a/SdkImageCreator/src/org/tizen/installmanager/ui/dialog/AddExtraRepositoryDialog.java b/SdkImageCreator/src/org/tizen/installmanager/ui/dialog/AddExtraRepositoryDialog.java
deleted file mode 100644 (file)
index 8258ec4..0000000
+++ /dev/null
@@ -1,300 +0,0 @@
-/*
- *  InstallManager
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: 
- * Wooyoung Cho <wooyoung1.cho@samsung.com>
- * Shihyun Kim <shihyun.kim@samsung.com>
- * Taeyoung Son <taeyoung2.son@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.ui.dialog;
-
-import java.util.HashSet;
-import java.util.LinkedHashMap;
-import java.util.Set;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.TableItem;
-import org.tizen.installmanager.core.SDKExtensionInfo;
-import org.tizen.installmanager.lib.Log;
-import org.tizen.installmanager.pkg.model.PackageSet;
-import org.tizen.installmanager.util.PathUtil;
-
-/**
- * This class supports to control(add, reomove) extra's repository.
- * 
- * @author Yongsung Kim <yongsung1.kim@samsung.com>
- */
-public class AddExtraRepositoryDialog extends Dialog {
-       private final String STRING_TITLE = "Add Extra Repository";
-       
-       private AddExtraDialog addDialog = null;
-       private String thirdPartyName = "";
-       private String thirdPartyRepository = "";
-       
-       //Repository table column
-       public static final int TABLE_COLUMN_NAME = 0;
-       public static final int TABLE_COLUMN_REPOSITORY = 1;
-       
-       private Table repositoryTable = null;
-       private Button addButton = null;
-       private Button removeButton = null;
-       private Button okButton = null;
-       
-       // Set of removable item list.
-       private Set<TableItem> removeRepositorySet;
-               
-       private SDKExtensionInfo sdkExtensionInfo = SDKExtensionInfo.getInstance();
-       
-       public AddExtraRepositoryDialog(Shell parentShell) {
-               super(parentShell);
-               setShellStyle(SWT.BORDER | SWT.TITLE | SWT.APPLICATION_MODAL);
-       }
-       
-       /**
-        * Return the initial size of the dialog.
-        */
-       @Override
-       protected Point getInitialSize() {
-               return new Point(500, 400);
-       }
-       
-       /**
-        * Create contents of the dialog.
-        * 
-        * @param parent
-        */
-       @Override
-       protected Control createDialogArea(Composite parent) {
-               Composite container = (Composite) super.createDialogArea(parent);
-               container.setLayout(null);
-               container.getShell().setImage(PathUtil.getImageFromResource("/res/icons/SDK_icon.png"));
-               
-               sdkExtensionInfo.load();
-               removeRepositorySet = new HashSet<TableItem>();
-               
-               setTitle();
-               setRepositoryTable(container);
-               addItemToRepositoryTable(sdkExtensionInfo.getExtensionRepositories());
-               
-               setSeparator(container);
-               
-               setAddButton(container);
-               setRemoveButton(container);
-               
-               return container;
-       }
-       
-       /**
-        * Set page title
-        */
-       private void setTitle() {
-               getShell().setText(STRING_TITLE);
-       }
-       
-       @Override
-       protected void okPressed() {
-               this.close();
-       }
-       
-       /**
-        * Set 3rd party repository table.
-        * @param composite
-        */
-       private void setRepositoryTable(Composite composite) {
-               if (repositoryTable == null) {
-                       repositoryTable = new Table(composite, SWT.BORDER | SWT.FULL_SELECTION | SWT.CHECK);                    
-               }
-               
-               repositoryTable.forceFocus();
-               repositoryTable.setBounds(5, 5, 380, 305);
-               repositoryTable.setLayout(new FillLayout());
-               
-               setTableColumn();
-               
-               repositoryTable.setHeaderVisible(true);
-               repositoryTable.setLinesVisible(true);
-               
-               repositoryTable.addSelectionListener(new SelectionAdapter() {
-                       @Override
-                       public void widgetSelected(SelectionEvent e) {
-                               TableItem selectedItem = (TableItem) e.item;
-                               if (selectedItem.getChecked() == true) {
-                                       removeRepositorySet.add(selectedItem);
-                               } else {
-                                       removeRepositorySet.remove(selectedItem);
-                               }
-                               
-                               if (removeRepositorySet.isEmpty()) {
-                                       removeButton.setEnabled(false);
-                               } else {
-                                       removeButton.setEnabled(true);
-                               }
-                       }
-               });
-       }
-       
-       /**
-        * Set table column.
-        */
-       private void setTableColumn() {
-               TableColumn tcName = new TableColumn(repositoryTable, SWT.CENTER);
-               TableColumn tcRepository = new TableColumn(repositoryTable, SWT.CENTER);
-               
-               tcName.setText("Name");
-               tcRepository.setText("Repository");
-               
-               tcName.setWidth(100);
-               tcName.setResizable(false);
-               tcRepository.setWidth(270);
-               tcRepository.setResizable(false);
-       }
-       
-       /**
-        * Show 3rd party information on table.
-        * @param type
-        */
-       private void showRepositoryTable() {
-               repositoryTable.removeAll();
-               removeRepositorySet.clear();
-               addItemToRepositoryTable(sdkExtensionInfo.getExtensionRepositories());
-       }
-       
-       /**
-        * Add 3rd party information to table by row.
-        * @param 
-        */
-       private void addItemToRepositoryTable(LinkedHashMap<String, String> repositoryInfo) {
-               Set<String> keys = repositoryInfo.keySet();
-               for (String key : keys) {
-                       TableItem item = new TableItem(repositoryTable, SWT.NONE);
-                       item.setText(TABLE_COLUMN_NAME, repositoryInfo.get(key));
-                       item.setText(TABLE_COLUMN_REPOSITORY, key);
-               }
-       }
-       
-       private void setSeparator(Composite composite) {
-               Label sep = new Label(composite, SWT.SEPARATOR | SWT.HORIZONTAL);
-               sep.setBounds(0, 320, 500, 1);
-       }
-       
-       /**
-        * Set Add repository button.
-        * @param composite
-        */
-       private void setAddButton(Composite composite) {
-               if (addButton == null) {
-                       addButton = new Button(composite, SWT.NONE);
-               }
-               
-               addButton.setBounds(390, 10, 88, 27);
-               addButton.setText("Add");
-               
-               addButton.addSelectionListener(new SelectionAdapter() {
-                       @Override
-                       public void widgetSelected(SelectionEvent e) {
-                               addDialog = new AddExtraDialog(getShell());
-                               
-                               int ret = addDialog.open();
-                               
-                               if (ret == 0) {
-                                       thirdPartyName = addDialog.getThirdPartyName(); // 3rd party name via location dialog.
-                                       thirdPartyRepository = addDialog.getThirdPartyRepository(); // 3rd party repository via location dialog.
-                                       addRepositoryInformation();
-                                       showRepositoryTable();
-                               } else {
-                                       Log.err("Cannot open add 3rd party repository dialog.");
-                               }
-                       }
-               });
-       }
-       
-       /**
-        * Set button to remove item which is checked.
-        * @param composite
-        */
-       private void setRemoveButton(Composite composite) {
-               if (removeButton == null) {
-                       removeButton = new Button(composite, SWT.NONE);
-               }
-               
-               removeButton.setBounds(390, 42, 88, 27);
-               removeButton.setText("Remove");
-               removeButton.setEnabled(false);
-               
-               removeButton.addSelectionListener(new SelectionAdapter() {
-                       @Override
-                       public void widgetSelected(SelectionEvent e) {
-                               removeRepositoryInformation();
-                               showRepositoryTable();
-                       }
-               });
-       }
-       
-       /**
-        * Write 3rd party information of adding to installmanager.conf 
-        */
-       private void addRepositoryInformation() {
-               sdkExtensionInfo.add(thirdPartyName, thirdPartyRepository);
-               sdkExtensionInfo.save();
-       }
-       
-       /**
-        * Write 3rd party information of removing to installmanager.conf
-        */
-       private void removeRepositoryInformation() {
-               for (TableItem removeItem : removeRepositorySet) {
-                       sdkExtensionInfo.remove(removeItem.getText(1));
-               }
-               sdkExtensionInfo.save();
-       }
-       
-       public PackageSet getPackagesFromExtraRepository() {
-               return sdkExtensionInfo.getExtensionPackages();
-       }
-       /**
-        * Set to enable OK button.
-        * 
-        * @param isAvailable
-        */
-       public void okButtonEnable(boolean isAvailable) {
-               okButton = getButton(Window.OK);
-               okButton.setEnabled(isAvailable);
-       }
-       
-       public SDKExtensionInfo getSdkExtensionInfo() {
-               return sdkExtensionInfo;
-       }
-}
diff --git a/SdkImageCreator/src/org/tizen/installmanager/ui/dialog/ChangeServerDialog.java b/SdkImageCreator/src/org/tizen/installmanager/ui/dialog/ChangeServerDialog.java
deleted file mode 100644 (file)
index c404cf3..0000000
+++ /dev/null
@@ -1,146 +0,0 @@
-package org.tizen.installmanager.ui.dialog;\r
-\r
-import java.net.MalformedURLException;\r
-import java.net.URL;\r
-\r
-import org.eclipse.jface.dialogs.Dialog;\r
-import org.eclipse.swt.SWT;\r
-import org.eclipse.swt.graphics.Color;\r
-import org.eclipse.swt.graphics.Point;\r
-import org.eclipse.swt.widgets.Composite;\r
-import org.eclipse.swt.widgets.Control;\r
-import org.eclipse.swt.widgets.Label;\r
-import org.eclipse.swt.widgets.Shell;\r
-import org.eclipse.swt.widgets.Text;\r
-import org.tizen.installmanager.core.Config;\r
-import org.tizen.installmanager.lib.Downloader;\r
-import org.tizen.installmanager.lib.ErrorController;\r
-import org.tizen.installmanager.util.PathUtil;\r
-\r
-public class ChangeServerDialog extends Dialog {\r
-       private static final String STRING_TITLE = "Change Server";\r
-       private Label titleLabel = null;\r
-       private Text serverText = null;\r
-       private Label errLabel = null;\r
-       \r
-       private String serverUrl = "";\r
-       \r
-       public ChangeServerDialog(Shell parentShell) {\r
-               super(parentShell);\r
-               setShellStyle(SWT.BORDER | SWT.TITLE | SWT.APPLICATION_MODAL);\r
-       }\r
-       \r
-       /**\r
-        * Return the initial size of the dialog.\r
-        */\r
-       @Override\r
-       protected Point getInitialSize() {\r
-               return new Point(400, 190);\r
-       }\r
-       \r
-       /**\r
-        * Create contents of the dialog.\r
-        * @param parent\r
-        */\r
-       @Override\r
-       protected Control createDialogArea(Composite parent) {\r
-               Composite container = (Composite) super.createDialogArea(parent);\r
-               container.setLayout(null);\r
-               container.getShell().setImage(PathUtil.getImageFromResource("/res/icons/SDK_icon.png"));\r
-               \r
-               setTitle();\r
-               setTitleLabel(container);\r
-               setServerUrlText(container);\r
-               setErrLabel(container);\r
-\r
-               return container;\r
-       }\r
-       \r
-       @Override\r
-       protected void okPressed() {\r
-               String changeServerUrl = serverText.getText();\r
-               \r
-               if (serverUrl.equals(changeServerUrl)) {\r
-                       this.close();\r
-               } else {                        \r
-                       if (isExactFormat(changeServerUrl)) {\r
-                               serverUrl = changeServerUrl;\r
-                               this.close();\r
-                       } else {\r
-                               // do not close configuration dialog because of wrong pkg list path.\r
-                       }\r
-               }\r
-       }\r
-       \r
-       /**\r
-        * Set page title\r
-        */\r
-       private void setTitle() {\r
-               getShell().setText(STRING_TITLE);\r
-       }\r
-       \r
-       private void setTitleLabel(Composite composite) {\r
-               titleLabel = new Label(composite, SWT.NONE);\r
-               titleLabel.setText("Input New Server");\r
-               titleLabel.setBounds(10, 10, 200, 23);\r
-       }\r
-       \r
-       private void setServerUrlText(Composite composite) {\r
-               serverText = new Text(composite, SWT.BORDER);\r
-               serverText.setBounds(10, 33, 360, 23);\r
-               serverText.setEnabled(true);\r
-               \r
-               if (serverUrl.isEmpty()) {\r
-                       serverText.setText("http://");\r
-               } else {\r
-                       serverText.setText(serverUrl);\r
-                       serverText.selectAll();\r
-               }\r
-       }\r
-       \r
-       private void setErrLabel(Composite composite) {\r
-               errLabel = new Label(composite, SWT.WRAP);\r
-               errLabel.setBounds(10, 58, 350, 100);\r
-               errLabel.setForeground(new Color(null, 255, 0, 0));\r
-       }\r
-       \r
-       private boolean isExactFormat(String serverUrl) {\r
-               boolean result = false;\r
-               if (!serverUrl.startsWith("http://")) {\r
-                       errLabel.setText("Enter the URL in a correct format.");\r
-                       return false;\r
-               }\r
-               \r
-               try {\r
-                       URL distInfoFileURL = new URL(PathUtil.addURLPath(serverUrl, Config.REPOSITORY_DISTRIBUTION_INFO_FILE));\r
-                       \r
-                       Downloader downloader = new Downloader();\r
-                       result = downloader.connect(distInfoFileURL);\r
-                       \r
-                       if (!result) {\r
-                               errLabel.setText(ErrorController.getErrorMessage());\r
-                       }\r
-               } catch (MalformedURLException e) {\r
-                       errLabel.setText("Enter the URL in a correct format.");\r
-                       return false;\r
-               }  catch (IllegalArgumentException e) {\r
-                       errLabel.setText("Connection to the input URL failed.");\r
-                       // the connection does not work.(wrong URL address)\r
-                       return false;\r
-               }\r
-\r
-               return result;\r
-       }\r
-       \r
-       /**\r
-        * Set server address to text ui in dialog.\r
-        * @param url current server address.\r
-        */\r
-       public void setCurrentServer(String url) {\r
-               serverUrl = url; \r
-       }\r
-       \r
-       public String getServerUrl() {\r
-               return serverUrl;\r
-       }\r
-}\r
diff --git a/SdkImageCreator/src/org/tizen/installmanager/ui/dialog/ConfigurationDialog.java b/SdkImageCreator/src/org/tizen/installmanager/ui/dialog/ConfigurationDialog.java
deleted file mode 100644 (file)
index d7191d3..0000000
+++ /dev/null
@@ -1,925 +0,0 @@
-/*
- *  InstallManager
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: 
- * Wooyoung Cho <wooyoung1.cho@samsung.com>
- * Shihyun Kim <shihyun.kim@samsung.com>
- * Taeyoung Son <taeyoung2.son@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.ui.dialog;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.Collection;
-import java.util.Date;
-import java.util.List;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipFile;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.window.Window;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.MouseListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.FileDialog;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.TableItem;
-import org.tizen.installmanager.core.Config;
-import org.tizen.installmanager.core.DistributionController;
-import org.tizen.installmanager.core.InstallManager;
-import org.tizen.installmanager.core.Config.ServerType;
-import org.tizen.installmanager.core.IMFatalException;
-import org.tizen.installmanager.core.SnapshotLog;
-import org.tizen.installmanager.lib.Log;
-import org.tizen.installmanager.lib.SDKPackageFormat;
-import org.tizen.installmanager.lib.ErrorController.ErrorCode;
-import org.tizen.installmanager.pkg.lib.PackageManager;
-import org.tizen.installmanager.pkg.model.Snapshot;
-import org.tizen.installmanager.pkg.model.SnapshotList;
-import org.tizen.installmanager.ui.dialog.MessageBoxDlg.DialogType;
-import org.tizen.installmanager.util.PathUtil;
-
-
-/**
- * This class supports snapshot, user package server and local install.
- * 
- * @author Yongsung Kim <yongsung1.kim@samsung.com>
- */
-public class ConfigurationDialog extends Dialog {
-       //return data
-       private String snapshotPath = "";
-       private String currentDistribution = "";
-       private String repository = "";
-       private ServerType serverType = ServerType.SNAPSHOT;
-       
-//     private ChangeServerDialog changeServerDialog = null;
-
-       private SnapshotLogDialog snapshotDialog = null;
-       private static final String STRING_TITLE = "Advanced Configuration";
-
-       private Button buttonSnapshot = null;
-       private Button buttonLocal = null;
-       private Button buttonSelectImage = null;
-       private Button okBtn;
-       private Button buttonChangeServer;
-       private Combo distributionCombo = null;
-       private Button latestVersionCheckBox = null;
-       private Button buttonSnapshotFilter = null;
-
-       private Table snapshotTable;
-
-       private Label localErrLabel;
-       private Label textPackageServerUrl;
-       private Label textLocalServerUrl;
-       private File imageFile;
-       private long unzipResult = -1;
-       
-       private DistributionController controller =  null;
-       private boolean noErr = true; // flag check to verify pkg list file path.
-       
-       //snapshot table column
-       public static final int TABLE_STATUS = 0;
-       public static final int TABLE_NAME = 1;
-       public static final int TABLE_DATE = 2;
-       
-       //snapshot table status
-       public static final String STATUS_LATEST = "Latest";
-       
-       private static final String SDK_IMAGE_ZIP_EXTENSION = ".zip";
-       
-       public ConfigurationDialog(Shell parentShell) {
-               super(parentShell);
-               setShellStyle(SWT.BORDER | SWT.TITLE | SWT.APPLICATION_MODAL);
-               controller = DistributionController.getInstance();
-       }
-
-       /**
-        * Create contents of the dialog.
-        * 
-        * @param parent
-        */
-       @Override
-       protected Control createDialogArea(Composite parent) {
-               Composite container = (Composite) super.createDialogArea(parent);
-               container.setLayout(null);
-
-               setTitle();
-
-               setSnapshotButton(container);
-               packageServerLabel(container);
-               setChangeUrlButton(container);
-               setDistributionComboBox(container);
-               setLatestVersionCheckBox(container);
-               setSnapshotFilter(container);
-               makeSnapshotTable(container);
-               showSnapshotTable(currentDistribution);
-               setSelectionBySnapshotPath();
-
-               setSeparator(container);
-               
-               setLocalButton(container);
-               setFileDialog(container);
-               setLocalLabel(container);
-               setLocalErrorlabel(container);
-               
-               return container;
-       }
-       
-       protected Button getOKButton() {
-               Button button = getButton(IDialogConstants.OK_ID);
-               return button;
-       }
-
-       @Override
-       protected void okPressed() {
-               
-               if (buttonLocal.getSelection()) {
-                       if (unzipSDKImageFile(imageFile) > 0) {
-                               this.serverType = ServerType.LOCAL;
-                       } else {
-                               Log.err("unzip SDK IMAGE FILE fail. => " + imageFile.getName());
-                               throw new IMFatalException(ErrorCode.FAIL_TO_EXTRACT_SDK_IMAGE_FILE);
-                       }
-                       
-               } else {
-                       this.serverType = ServerType.SNAPSHOT;
-               }
-               
-               if (noErr) {
-                       // everything is good. keep going ahead.
-                       this.close();
-               }
-       }
-
-       /**
-        * Return the initial size of the dialog.
-        */
-       @Override
-       protected Point getInitialSize() {
-               return new Point(580, 485);
-       }
-       
-       public void setComboList(List<String> list) {
-               
-       }
-
-       /**
-        * Set snapshot path by snapshot name.
-        * @param name snapshot name
-        */
-       public void setSnapshotPathByName(String name) {
-               SnapshotList snapshotSet = controller.getSnapshotList(currentDistribution);
-               
-               if (snapshotSet == null) {
-                       throw new IMFatalException("Selected distribution(" + currentDistribution + ") do not exist in repository");
-               }
-               
-               Snapshot currentSnapshot = snapshotSet.getSnapshotByName(name);
-               
-               if (currentSnapshot != null) {
-                       this.snapshotPath = currentSnapshot.getPath();
-               } else {
-                       this.snapshotPath = "";
-               }
-       }
-       
-       public void setSnapshotPath(String path) {
-               SnapshotList snapshotSet = controller.getSnapshotList(currentDistribution);
-               
-               if (snapshotSet == null) {
-                       throw new IMFatalException("Selected distribution(" + currentDistribution + ") do not exist in repository");
-               }
-               
-               Snapshot currentSnapshot = snapshotSet.getSnapshotByPath(path);
-               
-               if (currentSnapshot != null) {
-                       this.snapshotPath = currentSnapshot.getPath();
-               } else {
-                       this.snapshotPath = "";
-               }
-       }
-
-       public void setRepository(String serverUrl) {
-               if (serverUrl == null || serverUrl.isEmpty()) {
-                       return;
-               }
-               
-               this.repository = serverUrl;
-       }
-       
-       /**
-        * Change package server type by install type(normal, snapshot, local).
-        * @param isConfDialog User push 'OK' button in configuration dialog is true, otherwise is false.
-        */
-       public void setServerType() {
-               if (buttonSnapshot.getSelection()) {
-                       serverType = ServerType.SNAPSHOT;
-               } else if (buttonLocal.getSelection()) {
-                       serverType = ServerType.PACKAGE;
-               } else {
-                       Log.err("Snapshot or package server button is not selection in configuration page.");
-                       serverType = ServerType.SNAPSHOT;
-               }                       
-       }
-       
-       /**
-        * Get package server url from Text widget. 
-        * @return
-        */
-       public String getRepository() {
-               return repository;
-       }
-
-       /**
-        * Set snapshot type
-        * 
-        * @param type
-        *            selected snapshot type.
-        */
-       public void setCurrentDistribution(String type) {
-               this.currentDistribution = type;
-       }
-
-       /**
-        * Get snapshot type
-        * 
-        * @return
-        */
-       public String getCurrentDistribution() {
-               return currentDistribution.toLowerCase();
-       }
-
-       /**
-        * Get snapshot path
-        * 
-        * @return snapshot path
-        */
-       public String getSnapshotPath() {
-               return snapshotPath;
-       }
-
-       /**
-        * Set page title
-        */
-       private void setTitle() {
-               getShell().setText(STRING_TITLE);
-       }
-       
-       private void setPackageServerEnv(String packageServerPath) {
-               this.repository = packageServerPath;
-               textPackageServerUrl.setText(packageServerPath);
-               
-               //refresh information of distribution
-               refreshDistribution();
-               
-               //refresh combobox of distribution
-               distributionCombo.removeAll();
-               List<String> distributions = controller.getDistributionList();
-               addDistributionsToDistributionCombo(distributions);
-               if (distributions.size() > 0) {
-                       currentDistribution = distributions.get(0);
-                       distributionCombo.select(0);
-               }
-               
-               //refresh snapshot list
-               snapshotTable.clearAll();
-               showSnapshotTable(distributionCombo.getText());
-               if (snapshotTable.getItems().length > 0) {
-                       snapshotTable.setSelection(0);
-               }
-       }
-       
-       private void refreshDistribution() {
-               Config.getInstance().getConfigFile().setRepository(repository);
-               InstallManager.getInstance().initDistribution();
-               this.controller = DistributionController.getInstance();
-       }
-
-       /**
-        * Set snapshot radio button.
-        * 
-        * @param composite
-        */
-       private void setSnapshotButton(Composite composite) {
-               if (buttonSnapshot == null) {
-                       buttonSnapshot = new Button(composite, SWT.RADIO);                      
-               }
-
-               buttonSnapshot.setSelection(true);
-               buttonSnapshot.addSelectionListener(new SelectionAdapter() {
-                       @Override
-                       public void widgetSelected(SelectionEvent e) {
-                               distributionCombo.setEnabled(true);
-                               buttonSnapshotFilter.setEnabled(true);
-                               buttonChangeServer.setEnabled(true);
-                               buttonSelectImage.setEnabled(false);
-                               textLocalServerUrl.setEnabled(false);
-                               textLocalServerUrl.setText("");
-                               localErrLabel.setText("");
-                               setOkEnable(false);
-                       }
-               });
-
-               buttonSnapshot.setBounds(10, 10, 130, 20);
-
-               buttonSnapshot.setText("Package Server : ");
-       }
-       
-       /**
-        * Set url label
-        * 
-        * @param composite
-        */
-       private void packageServerLabel(Composite composite) {
-               if (textPackageServerUrl == null) {
-                       textPackageServerUrl = new Label(composite, SWT.BORDER);                        
-               }
-
-               textPackageServerUrl.setBounds(150, 10, 300, 20);
-               textPackageServerUrl.setEnabled(false);
-               textPackageServerUrl.setText(this.repository);
-       }
-       
-       private void setChangeUrlButton(final Composite composite) {
-               if (buttonChangeServer == null) {
-                       buttonChangeServer = new Button(composite, SWT.PUSH);                   
-               }
-
-               buttonChangeServer.setText("Change Server");
-               buttonChangeServer.setBounds(455, 7, 115, 27);
-               buttonChangeServer.setEnabled(true);
-               
-               buttonChangeServer.addSelectionListener(new SelectionAdapter() {
-                       public void widgetSelected(SelectionEvent e) {
-                               ChangeServerDialog changeServerDialog = new ChangeServerDialog(composite.getShell());
-                               changeServerDialog.setCurrentServer(repository);
-                               int ret = changeServerDialog.open();
-                               if (ret == 0) {
-                                       String changeServerUrl = changeServerDialog.getServerUrl();
-                                       if (!repository.equals(changeServerUrl)) {
-                                               setPackageServerEnv(changeServerUrl);
-                                       }
-                               } else {
-                                       Log.log("ChangeServer dialog is canceled.");                                    
-                               }
-                       }
-               });
-       }
-       
-       /**
-        * Set snapshot type combo box.
-        * 
-        * @param composite
-        */
-       private void setDistributionComboBox(Composite composite) {
-               if (distributionCombo == null) {
-                       distributionCombo = new Combo(composite, SWT.READ_ONLY);                        
-               }
-               
-               addDistributionsToDistributionCombo(controller.getDistributionList());
-               
-               Label distLabel = new Label(composite, SWT.NONE);
-               distLabel.setBounds(10, 45, 100, 20);
-               distLabel.setText("Distribution : ");
-               
-               distributionCombo.setText(currentDistribution);
-               distributionCombo.setBounds(104, 40, 90, 20);
-               distributionCombo.setEnabled(true);
-               
-               distributionCombo.addSelectionListener(new SelectionListener() {
-                       @Override
-                       public void widgetSelected(SelectionEvent e) {
-                               String distribution = distributionCombo.getText();
-                               
-                               if (currentDistribution.equals(distribution)) {
-                                       return;
-                               } else {
-                                       showSnapshotTable(distribution);
-                                       
-                                       if (snapshotTable.getItemCount() > 0) {
-                                               if (latestVersionCheckBox.getSelection()) {
-                                                       snapshotTable.deselectAll();
-                                               } else {
-                                                       snapshotTable.select(0);
-                                                       setSnapshotPathByName(snapshotTable.getSelection()[0].getText(1));
-                                               }
-                                               
-                                               currentDistribution = distribution;
-                                               Config.fromWhere = Config.ConfDialog.SNAPSHOT; // it means data from table.
-                                       }
-                               }
-                       }
-
-                       @Override
-                       public void widgetDefaultSelected(SelectionEvent arg0) {
-                       }
-               });
-       }
-       
-       private void setLatestVersionCheckBox(Composite composite) {
-               if (latestVersionCheckBox == null) {
-                       latestVersionCheckBox = new Button(composite, SWT.CHECK);
-               }
-               
-               latestVersionCheckBox.setText("Auto update");
-               latestVersionCheckBox.setBounds(205, 45, 100, 20);
-               latestVersionCheckBox.setEnabled(true);
-               latestVersionCheckBox.pack();
-               
-               if(this.snapshotPath.isEmpty()) {
-                       latestVersionCheckBox.setSelection(true);
-               } else {
-                       latestVersionCheckBox.setSelection(false);
-               }
-
-               latestVersionCheckBox.addSelectionListener(new SelectionAdapter() {
-                       public void widgetSelected(SelectionEvent e) {
-                               if (latestVersionCheckBox.getSelection()) {
-                                       snapshotTable.deselectAll();
-                                       snapshotTable.setEnabled(false);
-                                       buttonSnapshotFilter.setEnabled(false);
-                                       snapshotPath = "";
-                               } else {
-                                       snapshotTable.setEnabled(true);
-                                       buttonSnapshotFilter.setEnabled(true);
-                                       
-                                       if (snapshotTable.getItemCount() > 0) {
-                                               snapshotTable.select(0);
-                                               setSnapshotPathByName(snapshotTable.getSelection()[0].getText(1));
-                                       } else {}
-                               }
-                       }
-               });
-       }
-       
-       private void addDistributionsToDistributionCombo(Collection<String> distList) {
-               if (distributionCombo == null || distList == null) {
-                       return;
-               }
-               
-               for (String dist : distList) {
-                       if (dist != null) {
-                               distributionCombo.add(dist);                            
-                       }
-               }
-       }
-       
-       private void setSnapshotFilter(Composite composite) {
-               if (buttonSnapshotFilter == null) {
-                       buttonSnapshotFilter = new Button(composite, SWT.CHECK);
-               }
-               
-               buttonSnapshotFilter.setText("Show all");
-               buttonSnapshotFilter.setBounds(480, 45, 100, 20);
-               buttonSnapshotFilter.pack();
-               
-               if (latestVersionCheckBox.getSelection()) {
-                       buttonSnapshotFilter.setEnabled(false);
-               } else {
-                       buttonSnapshotFilter.setEnabled(true);
-               }
-               
-               buttonSnapshotFilter.setSelection(false);
-                       buttonSnapshotFilter.addSelectionListener(new SelectionAdapter() {
-                       public void widgetSelected(SelectionEvent e) {
-                               showSnapshotTable(currentDistribution);
-                       }
-               });
-       }
-
-       /**
-        * Make snapshot table.
-        * 
-        * @param composite
-        * @return Snapshot table object.
-        */
-       private Table makeSnapshotTable(Composite composite) {
-               if (snapshotTable == null) {
-                       snapshotTable = new Table(composite, SWT.BORDER | SWT.FULL_SELECTION);                  
-               }
-
-               snapshotTable.forceFocus();
-               snapshotTable.setBounds(10, 70, 560, 200);
-               snapshotTable.setLayout(new FillLayout());
-               
-               if (latestVersionCheckBox.getSelection()) {
-                       snapshotTable.setEnabled(false);
-               } else {
-                       snapshotTable.setEnabled(true);
-               }
-
-               TableColumn tcStatus = new TableColumn(snapshotTable, SWT.CENTER);
-               TableColumn tcLabel = new TableColumn(snapshotTable, SWT.CENTER);
-               TableColumn tcDate = new TableColumn(snapshotTable, SWT.CENTER);
-
-               tcStatus.setText("Status");
-               tcLabel.setText("Name");
-               tcDate.setText("Date");
-               tcStatus.setWidth(109);
-               tcLabel.setWidth(193);
-               tcDate.setWidth(214);
-
-               snapshotTable.addSelectionListener(new SelectionAdapter() {
-                       
-                       @Override
-                       public void widgetSelected(SelectionEvent e) {
-                               snapshotTable.setEnabled(!latestVersionCheckBox.getSelection());
-                               buttonSnapshot.setSelection(true);
-                               buttonSnapshotFilter.setEnabled(true);
-                               buttonChangeServer.setEnabled(true);
-                               distributionCombo.setEnabled(true);
-                               
-                               buttonLocal.setSelection(false);
-                               textLocalServerUrl.setEnabled(false);
-                               textLocalServerUrl.setText("");
-                               localErrLabel.setText("");
-                               buttonSelectImage.setEnabled(false);
-                               
-                               setOkEnable(true);
-                       
-                               setSnapshotPathByName(snapshotTable.getSelection()[0].getText(1));
-                               Config.fromWhere = Config.ConfDialog.SNAPSHOT; // it means data from table.
-                       }
-               });
-               
-               snapshotTable.addMouseListener(new MouseListener() {
-                       @Override
-                       public void mouseUp(MouseEvent e) {
-                               // TODO nothing
-                       }
-                       
-                       @Override
-                       public void mouseDown(MouseEvent e) {
-                               // TODO nothing
-                       }
-                       
-                       @Override
-                       public void mouseDoubleClick(MouseEvent e) {
-                               Point point = new Point(e.x, e.y);
-                               TableItem item = snapshotTable.getItem(point);
-                               
-                               String repo = Config.getInstance().getConfigFile().getRepository();
-                               String dist = distributionCombo.getItem(distributionCombo.getSelectionIndex());
-
-                               SnapshotLog snapshotLog = new SnapshotLog(PathUtil.addURLPath(repo, dist));
-                               String log = snapshotLog.getSnapshotLog(item.getText(TABLE_NAME));
-                               
-                               if (log == null) {
-                                       MessageBoxDlg.showDlg(
-                                                       getShell(),
-                                                       "Notice",
-                                                       "There is not information for snapshot \'" + item.getText(TABLE_NAME) + "\'.",
-                                                       DialogType.INFO, true);
-                               } else {
-                                       snapshotDialog = new SnapshotLogDialog(getShell(), log, item.getText(TABLE_NAME));
-                                       int ret = snapshotDialog.open();
-                                       if (ret == 0) {
-                                               Log.log("Success to open Snapshot Log Dialog");
-                                       } else {
-                                               Log.err("Fail to open Snapshot Log Dialog");
-                                       }                                       
-                               }
-                       }
-               });
-               
-               return snapshotTable;
-       }
-       
-       private void setSelectionBySnapshotPath() {
-               if (latestVersionCheckBox.getSelection()) {
-                       snapshotTable.deselectAll();
-                       return;
-               }
-               
-               String distribution = distributionCombo.getText();
-               SnapshotList snapshotList = DistributionController.getInstance().getSnapshotList(distribution);
-               
-               Snapshot snapshot= snapshotList.getSnapshotByPath(snapshotPath);
-               
-               if (snapshot == null) {
-                       snapshotTable.select(0);
-               } else {
-                       String snapshotName = snapshot.getName();
-                       
-                       TableItem[] tItems = snapshotTable.getItems();
-                       for (TableItem tItem : tItems) {
-                               if (snapshotName.equals(tItem.getText(1))) {
-                                       snapshotTable.setSelection(tItem);
-                               }
-                       }
-               }
-       }
-
-       private void addItemToSnapshotTable(Snapshot snapshot) {
-               if (snapshot == null) {
-                       return;
-               } else {
-                       addItemToSnapshotTable(snapshot.getName(), snapshot.getTime());
-               }
-       }
-       
-       private void addLatestItemToSnapshotTable(Snapshot snapshot) {
-               addItemToSnapshotTable(STATUS_LATEST, snapshot.getName(), snapshot.getTime());
-       }
-       
-       /**
-        * Add snapshot to snapshot table by row.
-        * 
-        * @param snapshots
-        *            String[] of snapshot information.
-        */
-       private void addItemToSnapshotTable(String name, Date date) {
-               addItemToSnapshotTable("", name, date);
-       }
-       
-       private void addItemToSnapshotTable(String status, String name, Date date) {
-               TableItem item = new TableItem(snapshotTable, SWT.NONE);
-
-               item.setText(TABLE_STATUS, status);
-               item.setText(TABLE_NAME, name);
-               item.setText(TABLE_DATE, date.toString());
-       }
-
-       /**
-        * Show snapshot information by combo box selection.
-        * 
-        * @param distribution
-        */
-       private void showSnapshotTable(String distribution) {
-               snapshotTable.removeAll();
-               snapshotTable.setHeaderVisible(true);
-               
-               //add latest snapshot to table.
-               Snapshot latestSnapshot = controller.getLatestSnapshot(distribution);
-               if (latestSnapshot != null) {
-                       addLatestItemToSnapshotTable(latestSnapshot);
-               }
-               
-               if (buttonSnapshotFilter.getSelection()) {
-                       SnapshotList allSnapshots = controller.getSnapshotList(distribution);
-                       
-                       if (allSnapshots == null) {
-                               Log.log("Selected distribution(" + distribution + ") do not exist in repository");
-                               return;
-                       }
-                       
-                       for (Snapshot snapshot : allSnapshots) {
-                               if (!latestSnapshot.equals(snapshot)) {
-                                       addItemToSnapshotTable(snapshot);
-                               }
-                       }
-               } else {
-                       //add snapshots to table
-                       SnapshotList snapshots = controller.getManualSnapshotList(distribution);
-                       
-                       if (snapshots == null) {
-                               Log.log("Selected distribution(" + distribution + ") do not exist in repository");
-                               return;
-                       }
-                       
-                       for (Snapshot snapshot : snapshots) {
-                               if (!latestSnapshot.equals(snapshot)) {
-                                       addItemToSnapshotTable(snapshot);
-                               }
-                       }                       
-               }
-       }
-
-       private void setSeparator(Composite composite) {
-               Label sep = new Label(composite, SWT.SEPARATOR | SWT.HORIZONTAL);
-               sep.setBounds(10, 280, 560, 1);
-       }
-       
-       private void setLocalButton(Composite composite) {
-               buttonLocal = new Button(composite, SWT.RADIO);
-               buttonLocal.setSelection(false);
-               buttonLocal.setBounds(10, 290, 350, 18);
-               buttonLocal.setText("SDK Image");
-
-               buttonLocal.addSelectionListener(new SelectionAdapter() {
-                       @Override
-                       public void widgetSelected(SelectionEvent e) {
-                               textLocalServerUrl.setEnabled(true);
-                               buttonSelectImage.setEnabled(true);
-                               localErrLabel.setEnabled(true);
-                               
-                               distributionCombo.setEnabled(false);
-                               buttonChangeServer.setEnabled(false);
-                               buttonSnapshotFilter.setEnabled(false);
-                               
-                               snapshotPath = "";
-                       }
-               });
-       }
-       
-       /**
-        * Set url label
-        * 
-        * @param composite
-        */
-       private void setLocalLabel(Composite composite) {
-               textLocalServerUrl = new Label(composite, SWT.BORDER);
-               textLocalServerUrl.setBounds(10, 318, 500, 20);
-               textLocalServerUrl.setEnabled(false);
-       }       
-
-       /**
-        * Set file dialog button
-        * 
-        * @param composite
-        */
-       private void setFileDialog(Composite composite) {
-               buttonSelectImage = new Button(composite, SWT.NONE);
-               buttonSelectImage.setEnabled(false);
-               buttonSelectImage.addSelectionListener(new SelectionAdapter() {
-                       @Override
-                       public void widgetSelected(SelectionEvent e) {
-                               String strDir = showSettingInstallpathDlg();
-                               if (strDir != null) {   
-                                       if (strDir.endsWith(SDK_IMAGE_ZIP_EXTENSION)) {
-                                               imageFile = new File(strDir);
-                                               if (validation(strDir)) {
-                                                       textLocalServerUrl.setText(strDir);
-                                                       localErrLabel.setText("");
-                                                       setOkEnable(true);
-                                                       Config.fromWhere = Config.ConfDialog.LOCAL_IMAGE; // it means data from file dialog.
-                                               } else {
-                                                       MessageBoxDlg.showDlg(Display.getCurrent().getShells()[0], 
-                                                          "Error", 
-                                                          "No package list file is found in the image file. Check the image file.", 
-                                                          DialogType.ERROR, false);
-                                                       return;                                                 
-                                               }
-                                       } else {
-                                               MessageBoxDlg.showDlg(Display.getCurrent().getShells()[0], 
-                                                  "Error", 
-                                                  "Select the correct SDK image file.", 
-                                                  DialogType.ERROR, false);
-                                               return;
-                                       }
-                               }
-                       }
-               });
-
-               buttonSelectImage.setImage(PathUtil.getImageFromResource("/res/icons/icon_directory_open.png"));
-               buttonSelectImage.setBounds(520, 313, 35, 29);
-       }
-       
-       @SuppressWarnings("unused")
-       private boolean validation(String strDir) {
-               ZipFile zipFile = null;
-               ZipEntry entry = null;
-               
-               try {
-                       zipFile = new ZipFile(strDir);
-               } catch (IOException e) {
-                       Log.ExceptionLog(e);
-                       
-                       return false;
-               }
-
-               if (zipFile != null) {
-                       
-                       entry = zipFile.getEntry(PackageManager.getInstance().getPackageListFileName());
-                       
-                       try {
-                               zipFile.close();
-                       } catch (IOException e) {
-                               Log.ExceptionLog(e);
-                       }
-                       
-                       return ( entry != null ) ? true : false;
-               } else {
-                       return false;
-               }
-       }
-               
-       
-       private void setLocalErrorlabel(Composite composite) {
-               localErrLabel = new Label(composite, SWT.WRAP);
-               localErrLabel.setBounds(20, 343, 475, 45);
-               localErrLabel.setForeground(new Color(null, 255, 0, 0));
-       }
-
-       /**
-        * Show file path dialog when file dialog button is pushed.
-        * 
-        * @return File path that selected file.
-        */
-       private String showSettingInstallpathDlg() {
-               FileDialog dlg = new FileDialog(Display.getCurrent().getShells()[0]);
-               dlg.setText("Select the package image.");
-               String strDir = dlg.open();
-
-               return strDir;
-       }
-
-       /**
-        * Unzip SDK ImageFile.
-        * 
-        * @param imageFile SDK Image File.
-        * @return if success to unzip is 1, not -1 or 0.
-        */
-       private long unzipSDKImageFile(final File imageFile) {
-               Log.log("Start to unzip SDK Image File. => " + imageFile.getName());            
-
-               String sdkTempDir = PathUtil.getCurrentDir();
-               
-               final File sdkTempDirFile = new File(sdkTempDir);
-               if (!sdkTempDirFile.exists()) {
-                       sdkTempDirFile.mkdirs();
-               }
-               
-               final IndeterminateProgressDialog progressbar = IndeterminateProgressDialog.getInstance();
-               progressbar.updateName("Extracting the SDK image file...\n It can take few minutes.");
-               
-               Shell shell = progressbar.getParent();
-               shell.getDisplay().asyncExec(new Runnable(){
-                       public void run() {
-                               String imageFilePath = imageFile.getAbsolutePath();
-                               SDKPackageFormat format = SDKPackageFormat.createSDKPackageFormat();
-                               unzipResult = format.unZip(imageFilePath, sdkTempDirFile.getAbsolutePath(), null);
-                               progressbar.finish();
-                       }
-               });
-               
-               if (!shell.isDisposed()) {
-                       progressbar.open();
-               }
-               
-               if (unzipResult <= 0) {
-                       repository = "";
-               } else {
-                       repository = sdkTempDir;
-               }
-               
-               return unzipResult;
-       }
-       
-       /**
-        * get serverType.
-        * 
-        * @return
-        */
-       public ServerType getServerType() {
-               return serverType;
-       }
-
-       /**
-        * Set to enable OK button.
-        * 
-        * @param isAvailable
-        */
-       public void setOkEnable(boolean isAvailable) {
-               okBtn = getButton(Window.OK);
-               okBtn.setEnabled(isAvailable);
-       }
-       
-       /**
-        * Clear the data.
-        */
-       public void clear() {
-               if (!distributionCombo.isDisposed()) {
-                       distributionCombo.dispose();
-               }
-               
-               if (!snapshotTable.isDisposed()) {
-                       snapshotTable.clearAll();
-               }
-       }
-}
diff --git a/SdkImageCreator/src/org/tizen/installmanager/ui/dialog/IndeterminateProgressDialog.java b/SdkImageCreator/src/org/tizen/installmanager/ui/dialog/IndeterminateProgressDialog.java
deleted file mode 100644 (file)
index e30138a..0000000
+++ /dev/null
@@ -1,185 +0,0 @@
-/*
-*  InstallManager
-*
-* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
-*
-* Contact: 
-* Wooyoung Cho <wooyoung1.cho@samsung.com>
-* Shihyun Kim <shihyun.kim@samsung.com>
-* Taeyoung Son <taeyoung2.son@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.ui.dialog;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.widgets.Dialog;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Monitor;
-import org.eclipse.swt.widgets.ProgressBar;
-import org.eclipse.swt.widgets.Shell;
-import org.tizen.installmanager.util.PathUtil;
-
-/**
- * Before install manager window shows up, indeterminate dialog is displayed.
- * @author Shihyun Kim <shihyun.kim@samsung.com>
- */
-public class IndeterminateProgressDialog extends Dialog {
-       Display mDisplay = null;
-       Shell mShell = null;
-       Label mNameLabel = null;
-       ProgressBar mProgressBar = null;
-
-       boolean bCancel = false;
-       
-       private static IndeterminateProgressDialog progressDialog = null;
-
-       private IndeterminateProgressDialog(Shell parent, int style) {
-               super(parent, style);
-       }
-
-       private IndeterminateProgressDialog(Shell parent, int style, String title) {
-               super(parent, style);
-               mDisplay = getParent().getDisplay();
-               setText(title);
-               parent.getShell().setImage(PathUtil.getImageFromResource("/res/icons/SDK_icon.png"));
-       }
-
-       /**
-        * indeterminate dialog open.
-        */
-       public void open() {
-               createContents();
-               setCenterOfMonitor();
-               
-               mShell.open();
-               mShell.layout();
-
-               while (!mShell.isDisposed()) {
-                       if (!mDisplay.readAndDispatch()) {
-                               mDisplay.sleep();
-                       }
-               }
-       }
-
-       /**
-        * Indeterminate dialog places center of monitor.
-        */
-       public void setCenterOfMonitor() {
-               if (mShell.isDisposed()) {
-                       return;
-               }
-
-               Monitor monitor = mDisplay.getPrimaryMonitor();
-
-               Rectangle monitorRect = monitor.getBounds();
-               Rectangle shellRect = mShell.getBounds();
-
-               int centerX = monitorRect.x + (monitorRect.width - shellRect.width) / 2;
-               int centerY = monitorRect.y + (monitorRect.height - shellRect.height) / 2;
-
-               mShell.setLocation(centerX, centerY);
-       }
-
-       public void setLocation(int x, int y) {
-               if (mShell.isDisposed()) {
-                       return;
-               }
-
-               mShell.setLocation(x, y);
-       }
-
-       /**
-        * Create the indeterminate dialog with basic environments.
-        */
-       private void createContents() {
-               mShell = new Shell(getParent(), SWT.None | SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL);
-               mShell.setSize(300, 130);
-               mShell.setText("InstallManager");
-
-//             mProgressBar = new ProgressBar(mShell, SWT.INDETERMINATE);
-//             mProgressBar.setBounds(50, 43, 150, 17);
-
-               mNameLabel = new Label(mShell, SWT.NONE | SWT.CENTER);
-               mNameLabel.setBounds(25, 17, 250, 40);
-               mNameLabel.setText("file name");
-       }
-
-       /**
-        * Shows title on dialog.
-        * @param fileName is string that wants to show on dialog
-        */
-       public void updateName(final String fileName) {
-//             if (!mDisplay.isDisposed()) {
-//                     mNameLabel.setText(fileName);
-//             }
-               if (!mDisplay.isDisposed()) {
-                       mDisplay.asyncExec(new Runnable() {
-                               public void run() {
-                                       if (!mNameLabel.isDisposed()) {
-                                               if (fileName.length() > 30) {
-                                                       //String name = fileName.substring(0, 29);
-                                                       String name = fileName + "...";
-                                                       mNameLabel.setText(name);
-                                               }
-                                               else {
-                                                       mNameLabel.setText(fileName);
-                                               }
-                                       }
-                               }
-                       });
-               }
-       }
-
-       /**
-        * Set a display
-        * @param display
-        */
-       public void setDisplay(Display display) {
-               mDisplay = display;
-       }
-
-       /**
-        * Finish displaying the indeterminate dialog.
-        */
-       public void finish() {          
-               if (mShell == null || mShell.isDisposed()) {
-                       return;
-               }
-
-               if (!mDisplay.isDisposed()) {
-                       mDisplay.asyncExec(new Runnable() {
-                               public void run() {
-                                       mShell.close();
-                               }
-                       });
-               }
-       }
-
-       public static IndeterminateProgressDialog getInstance() {
-               if (progressDialog == null) {
-                       Shell shell = new Shell(Display.getCurrent());
-                       progressDialog = new IndeterminateProgressDialog(shell, SWT.NONE, "");
-               }
-               
-               return progressDialog;
-       }
-}
diff --git a/SdkImageCreator/src/org/tizen/installmanager/ui/dialog/LoginDlg.java b/SdkImageCreator/src/org/tizen/installmanager/ui/dialog/LoginDlg.java
deleted file mode 100644 (file)
index b845357..0000000
+++ /dev/null
@@ -1,171 +0,0 @@
-/*
-*  InstallManager
-*
-* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
-*
-* Contact: 
-* Wooyoung Cho <wooyoung1.cho@samsung.com>
-* Shihyun Kim <shihyun.kim@samsung.com>
-* Taeyoung Son <taeyoung2.son@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.ui.dialog;
-
-import java.net.URL;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.KeyAdapter;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.tizen.installmanager.ui.dialog.MessageBoxDlg.DialogType;
-import org.tizen.installmanager.util.PathUtil;
-
-
-/**
- * Install manager Login dialog. If a server need account, install manager can connect to server via this dialog.
- * @author Shihyun Kim <shihyun.kim@samsung.com>
- */
-public class LoginDlg extends Dialog {
-
-       private Text idText;
-       private Text pwText;
-       private String id;
-       private String pw;
-       private String repository = "";
-       private Label lblConnecting;
-       private int POSITION_X = 97;
-       private int POSITION_Y = 40;
-
-       public LoginDlg(Shell parentShell) {
-               super(parentShell);
-               setShellStyle(SWT.BORDER | SWT.TITLE | SWT.APPLICATION_MODAL);
-       }
-
-
-       /**
-        * Create contents of the dialog.
-        * @param parent
-        */
-       @Override
-       protected Control createDialogArea(Composite parent) {
-               Composite container = (Composite) super.createDialogArea(parent);
-               container.setLayout(null);
-
-               Label idLabel = new Label(container, SWT.NONE);
-               idLabel.setAlignment(SWT.RIGHT);
-               idLabel.setBounds(POSITION_X, POSITION_Y + 7, 74, 15);
-               idLabel.setText("ID :");
-
-               Label pwLabel = new Label(container, SWT.NONE);
-               pwLabel.setAlignment(SWT.RIGHT);
-               pwLabel.setBounds(POSITION_X, POSITION_Y + 40, 74, 15);
-               pwLabel.setText("Password :");
-
-               idText = new Text(container, SWT.BORDER);
-               idText.setBounds(POSITION_X + 80, POSITION_Y + 4, 183, 28);
-
-               pwText = new Text(container, SWT.BORDER | SWT.PASSWORD);
-               pwText.setBounds(POSITION_X + 80, POSITION_Y + 37, 183, 28);
-
-               Label label = new Label(container, SWT.CENTER);
-               label.setImage(PathUtil.getImageFromResource("/res/icons/icon_login.png"));
-               label.setBounds(POSITION_X - 61, POSITION_Y - 1, 64, 64);
-
-               lblConnecting = new Label(container, SWT.WRAP);
-               lblConnecting.setBounds(19, 15, 328, 71);
-               lblConnecting.setEnabled(false);
-               if (repository != null) {
-                       lblConnecting.setText(repository);
-                       lblConnecting.setEnabled(true);
-                       idLabel.setBounds(POSITION_X, POSITION_Y + 7 + 50, 74, 15);
-                       pwLabel.setBounds(POSITION_X, POSITION_Y + 40 + 50, 74, 15);
-                       idText.setBounds(POSITION_X + 80, POSITION_Y + 4 + 50, 183, 28);
-                       pwText.setBounds(POSITION_X + 80, POSITION_Y + 37 + 50, 183, 28);
-                       label.setBounds(POSITION_X - 61, POSITION_Y - 1 + 50, 64, 64);
-               }
-
-               id = idText.getText();
-               pw = pwText.getText();
-
-               idText.addKeyListener(new KeyAdapter() {
-                       @Override
-                       public void keyReleased(KeyEvent arg0) {
-                               id = idText.getText();
-                       }
-               });
-
-               pwText.addKeyListener(new KeyAdapter() {
-                       @Override
-                       public void keyReleased(KeyEvent arg0) {
-                               pw = pwText.getText();
-                       }
-               });
-
-               return container;
-       }
-
-       @Override
-       protected void okPressed() {
-               if (id == null || id.length() < 1)
-                       MessageBoxDlg.showDlg(
-                                       this.getShell(), "Input ID", "Please input your ID.", DialogType.NOTIFY, false);
-
-               else if (pw == null || pw.length() < 1)
-                       MessageBoxDlg.showDlg(
-                                       this.getShell(), "Input Password", "Please input your password.",
-                                       DialogType.NOTIFY, false);
-               else
-                       this.close();
-       }
-
-       /**
-        * Return the initial size of the dialog.
-        */
-       @Override
-       protected Point getInitialSize() {
-               return new Point(376, 248);
-       }
-
-       public String getID() {
-               return id;
-       }
-
-       public String getPassword() {
-               return pw;
-       }
-
-       /**
-        * Set connecting url.
-        * @param url
-        */
-       public void setURL(URL url) {
-               if (url != null) {
-                       repository = "Please input user account for connecting \"" + url.toExternalForm() + "\".";
-                       if (lblConnecting != null)
-                               lblConnecting.setText(repository);
-               }
-       }
-}
diff --git a/SdkImageCreator/src/org/tizen/installmanager/ui/dialog/MessageBoxDlg.java b/SdkImageCreator/src/org/tizen/installmanager/ui/dialog/MessageBoxDlg.java
deleted file mode 100644 (file)
index 6d0bbb6..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
-*  InstallManager
-*
-* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
-*
-* Contact: 
-* Wooyoung Cho <wooyoung1.cho@samsung.com>
-* Shihyun Kim <shihyun.kim@samsung.com>
-* Taeyoung Son <taeyoung2.son@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.ui.dialog;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.MessageBox;
-import org.eclipse.swt.widgets.Shell;
-import org.tizen.installmanager.lib.Log;
-
-
-/**
- * Install manager need message box dialog for explaining state.
- * @author Taeyoung Son <taeyoung2.son@samsung.com>
- */
-public class MessageBoxDlg {
-       private static int result;
-       public static final int YES = 64;
-       public static final int NO = 128;
-       public static final int OK = 32;
-       public static final int CANCEL = 256;
-
-       /**
-        * INFO : Information for installing.<br>
-        * NOTIFY : Notification for installing.<br>
-        * WARNING : Warning for installing.<br>
-        * ERROR : Error for installing.
-        */
-       public enum DialogType {
-               INFO,
-               NOTIFY,
-               WARNING,
-               ERROR,
-       }
-
-       public static int showDlg(
-                       final Shell shell, final String title, final String msg, final DialogType dlgType, final boolean onlyOk) {
-               result = 0;
-
-               try {
-                       if (shell != null) {
-                               shell.getDisplay().syncExec(new Runnable() {
-                                       public void run() {
-                                               int style = 0;
-                                               if (dlgType == null) {
-                                                       return;
-                                               } else if (dlgType == DialogType.INFO) {
-                                                       style = SWT.OK | SWT.ICON_INFORMATION;
-                                               } else if (dlgType == DialogType.NOTIFY) {
-                                                       style = SWT.OK | SWT.ICON_INFORMATION;
-                                               } else if (dlgType == DialogType.WARNING) {
-                                                       style = SWT.YES | SWT.NO | SWT.ICON_WARNING;
-                                               } else if (dlgType == DialogType.ERROR) {
-                                                       style = SWT.OK | SWT.ICON_ERROR;
-                                               }
-                                               
-                                               if (onlyOk) {
-                                                       style = style | SWT.OK;
-                                               }
-                                               MessageBox dialog = new MessageBox(shell, style);
-                                               dialog.setText(title);
-                                               dialog.setMessage(msg);
-                                               result = dialog.open();
-                                       }
-                               });
-                       } else {
-                       }
-               } catch (Exception e) {
-                       Log.ExceptionLog(e);
-               }
-               return result;
-       }
-}
diff --git a/SdkImageCreator/src/org/tizen/installmanager/ui/dialog/SnapshotLogDialog.java b/SdkImageCreator/src/org/tizen/installmanager/ui/dialog/SnapshotLogDialog.java
deleted file mode 100644 (file)
index 20bbeeb..0000000
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- *  InstallManager
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: 
- * Wooyoung Cho <wooyoung1.cho@samsung.com>
- * Shihyun Kim <shihyun.kim@samsung.com>
- * Taeyoung Son <taeyoung2.son@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.ui.dialog;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.tizen.installmanager.util.PathUtil;
-
-/**
- * This class displays snapshot's change log.
- * 
- * @author Yongsung Kim <yongsung1.kim@samsung.com>
- */
-public class SnapshotLogDialog extends Dialog {
-       private String DIALOG_TITLE = null;
-       
-       private String snapshotLog = "";
-       private Text displayLogText;
-
-       /**
-        * @param parentShell
-        * @param log Selected snapshot's change log(information).
-        * @param snapshot Selected snapshot's name
-        */
-       protected SnapshotLogDialog(Shell parentShell, String log, String snapshot) {
-               super(parentShell);
-               snapshotLog = log;
-               DIALOG_TITLE = snapshot + " information.";
-               setShellStyle(SWT.BORDER | SWT.TITLE | SWT.APPLICATION_MODAL | SWT.RESIZE);
-       }
-       
-       /**
-        * Return the initial size of the dialog.
-        */
-       @Override
-       protected Point getInitialSize() {
-               return new Point(450, 300);
-       }
-       
-       /**
-        * Create contents of the dialog.
-        * 
-        * @param parent
-        */
-       @Override
-       protected Control createDialogArea(Composite parent) {
-               Composite container = (Composite) super.createDialogArea(parent);
-               FillLayout layout = new FillLayout(SWT.RESIZE);
-               container.setLayout(layout);
-               container.getShell().setImage(PathUtil.getImageFromResource("/res/icons/SDK_icon.png"));
-               
-               setTitle();
-               setDisplayLogText(container);
-               
-               return container;
-       }
-       
-       @Override
-       protected void createButtonsForButtonBar(Composite parent) {
-               createButton(parent, IDialogConstants.OK_ID, "OK", true);
-       }
-       
-       private void setTitle() {
-               getShell().setText(DIALOG_TITLE);
-       }
-       
-       private void setDisplayLogText(Composite composite) {
-               if (displayLogText == null) {
-                       displayLogText = new Text(composite, SWT.V_SCROLL | SWT.H_SCROLL | SWT.BORDER);
-               }
-
-               displayLogText.setText(snapshotLog);
-               displayLogText.setTextLimit(20);
-               displayLogText.setEnabled(true);
-               displayLogText.setEditable(false);
-       }
-}
diff --git a/SdkImageCreator/src/org/tizen/installmanager/ui/model/Item.java b/SdkImageCreator/src/org/tizen/installmanager/ui/model/Item.java
deleted file mode 100644 (file)
index 3f9b6b5..0000000
+++ /dev/null
@@ -1,582 +0,0 @@
-/*
-*  InstallManager
-*
-* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
-*
-* Contact: 
-* Wooyoung Cho <wooyoung1.cho@samsung.com>
-* Shihyun Kim <shihyun.kim@samsung.com>
-* Taeyoung Son <taeyoung2.son@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.ui.model;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.tizen.installmanager.pkg.lib.PackageManager;
-import org.tizen.installmanager.pkg.model.Package;
-import org.tizen.installmanager.pkg.model.PackageSet;
-
-/**
- * This class support items for tree view. 
- * @author Taeyong Son <taeyong2.son@samsung.com>
- */
-public class Item implements Comparable<Item> {
-       private Package latestPackage;
-       private Package installedPackage;
-       private Item parent;
-       private ArrayList<Item> children;
-       private CheckState  checkState= CheckState.UNCHECKED;
-       private InstallState installState = InstallState.INSTALL;
-
-       /**
-        * Package item status enumeration.<br>
-        * INSTALL : This item need to install.<br>
-        * UPDATE : This item need to update.<br>
-        * UNINSTALL : This item need to uninstall.
-        */
-       public enum InstallState {
-               INSTALL,
-               UPDATE,
-               SNAPSHOT,
-               UNINSTALL,
-       }
-       
-       /**
-        * item check status enumeration.<br>
-        * CHECKED : this item's check state is checked.<br>
-        * GRAYED : this item's check state is grayed.<br>
-        * UNCHECKED : this item's check state is unchecked.
-        */
-       public enum CheckState {
-               CHECKED,
-               GRAYED,
-               UNCHECKED
-       }
-
-       /**
-        * Construct Item class.
-        * @param parent
-        * @param name is item name.
-        * @param latestVersion is the latest version of item.
-        * @param installedVersion is a version of installed item already. 
-        * @param size is a item size.
-        * @param state is a item state.
-        */
-       public Item(Package latestPackage, Package installedPackage, InstallState state) {
-               setLatestPackage(latestPackage);
-               setInstalledPackage(installedPackage);
-               setInstallState(state);
-               
-               this.children = new ArrayList<Item>();
-       }
-
-       /**
-        * Get display name of item.
-        * @return
-        */
-       public String getDisplayName() {
-               if (latestPackage != null) {
-                       return latestPackage.getLabel();                                
-               } else {
-                       return "";
-               }
-       }
-       
-       /**
-        * Get package name of item.
-        * @return
-        */
-       public String getPackageName() {
-               if (latestPackage != null) {
-                       return latestPackage.getPackageName();
-               } else {
-                       return "";
-               }
-       }
-
-       /**
-        * Get package item current version.
-        * @return
-        */
-       public String getLatestVersion() {
-               if (latestPackage != null) {
-                       return latestPackage.getVersion().toString();
-               } else {
-                       return "";
-               }
-       }
-
-       /**
-        * Get package item installed version
-        * @return
-        */
-       public String getInstalledVersion() {
-               if (installedPackage != null) {
-                       return installedPackage.getVersion().toString();
-               } else {
-                       return "";
-               }
-       }
-       
-       /**
-        * Get total checked items size 
-        * @return Checked items size
-        */
-       public Long getSize() {
-               PackageManager pm = PackageManager.getInstance();
-               
-               if (pm == null) {
-                       return 0l;
-               } else {
-                       long size = 0l;
-                       PackageSet checkedChildPackages = getCheckedPackages();
-                       
-                       if (installState == InstallState.UNINSTALL) {
-                               size = pm.getTotalSizeOfRemovablePackages(checkedChildPackages);
-                       } else {
-                               size = pm.getTotalSizeOfInstallablePackages(checkedChildPackages);
-                       }
-                       
-                       return size;
-               }
-       }
-       
-       private ArrayList<Item> getCheckedItems() {             
-               ArrayList<Item> checkedItems = getCheckedChildItems();
-               
-               if (this.getCheckState() == CheckState.CHECKED) {
-                       checkedItems.add(this);
-               }
-               
-               return checkedItems;
-       }
-       
-       private ArrayList<Item> getCheckedChildItems() {
-               ArrayList<Item> checkedItems = new ArrayList<Item>();
-               
-               ArrayList<Item> childItems = getChildren();
-               for (Item childItem : childItems) {
-                       if (childItem.getCheckState() == CheckState.CHECKED) {
-                               checkedItems.add(childItem);
-                       } else if (childItem.getCheckState() == CheckState.GRAYED) {
-                               checkedItems.addAll(childItem.getCheckedChildItems());
-                       }
-               }
-               
-               return checkedItems;
-       }
-       
-       private PackageSet getCheckedPackages() {
-               PackageSet checkedPackages = new PackageSet();
-               
-               ArrayList<Item> checkedItems = getCheckedItems();
-               
-               for (Item checkedItem : checkedItems) {
-                       if (installState == InstallState.UNINSTALL) {
-                               checkedPackages.add(checkedItem.getInstalledPackage());
-                       } else {
-                               checkedPackages.add(checkedItem.getLatestPackage());
-                       }
-               }
-               
-               return checkedPackages;
-       }
-       
-       /**
-        * Get package item order
-        * @return item order
-        */
-       public int getPackageOrder() {
-               if (latestPackage != null) {
-                       return latestPackage.getOrder();
-               } else {
-                       return 0;
-               }
-       }
-
-       /**
-        * add child item on current item.
-        */
-       public void addChildItem(Item item) {
-               this.children.add(item);
-       }
-       
-       /**
-        * Clear children items on current item.
-        */
-       public void clearChildrenItems() {
-               this.children.clear();
-       }
-       
-       /**
-        * Get dependent package item on current item. 
-        * @return
-        */
-       public ArrayList<Item> getChildren() {
-               return children;
-       }
-
-       /**
-        * Check package is checked.
-        * @return true is checked, false is unchecked.
-        */
-       public CheckState getCheckState() {
-               return checkState;
-       }
-
-       /**
-        * Check package has child package.
-        * @return If package has children, return true. if not, return false.
-        */
-       public boolean hasChildren() {
-               return !getChildren().isEmpty();
-       }
-       
-       /**
-        * Get parent package.
-        * @return parent package.
-        */
-       public Item getParent() {               
-               return parent;
-       }
-       
-       /**
-        * Get latest package.
-        * @return
-        */
-       public Package getLatestPackage() {
-               return latestPackage;
-       }
-       
-       /**
-        * Get installed package.
-        * @return
-        */
-       public Package getInstalledPackage() {
-               return latestPackage;
-       }
-       
-       /**
-        * Get package that depends on the state.
-        * @return
-        */
-       public Package getPackage() {
-               if (this.installState == InstallState.UNINSTALL) {
-                       return installedPackage;
-               } else {
-                       return latestPackage;
-               }
-       }
-       
-       /**
-        * Set latest package for tree item.
-        * @param pkg
-        */
-       public void setLatestPackage(Package pkg) {
-               this.latestPackage = pkg;
-       }
-       
-       /**
-        * Set installed package for tree item.
-        * @param pkg
-        */
-       public void setInstalledPackage(Package pkg) {
-               this.installedPackage = pkg;
-       }
-
-       /**
-        * Set parent package.
-        * @param parent
-        */
-       public void setParent(Item parentItem) {
-               parent = parentItem;
-       }
-
-       /**
-        * Set package's checked flag.
-        * @param CHECKED is true, this package is selected by tree view.
-        */
-       public void setCheckState(CheckState state) {
-               this.checkState = state;
-       }
-       
-       public void setCheckState(boolean state) {
-               if (state) {
-                       this.checkState = CheckState.CHECKED;
-               } else {
-                       this.checkState = CheckState.UNCHECKED;
-               }
-       }
-
-       /**
-        * Set item's state.
-        * @param state
-        * @see InstallState
-        */
-       public void setInstallState(InstallState state) {
-               if (state == InstallState.UPDATE) {
-                       this.checkState = CheckState.CHECKED;
-               } else if (state == InstallState.UNINSTALL) {
-                       this.checkState = CheckState.UNCHECKED;
-               }
-               
-               this.installState = state;
-       }
-
-       /**
-        * Get item's state
-        * @return state
-        * @see InstallState
-        */
-       public InstallState getInstallState() {
-               return installState;
-       }
-       
-       /**
-        * Get item's display order
-        * @return display order
-        */
-       public int getOrder() {
-               return latestPackage.getOrder();
-       }
-       
-       /**
-        * Set state by children's state
-        */
-       public void setStateByChildren() {
-               setCheckStateByChildren(this);
-               setInstallStateByChildren(this);
-       }
-       
-       private void setCheckStateByChildren(Item parentItem) {
-               if (!parentItem.hasChildren()) {
-                       return;
-               } else {
-                       for (Item item : parentItem.getChildren()) {
-                               setCheckStateByChildren(item);
-                       }
-                       
-                       if (parentItem.isChildrenAllChecked()) {
-                               parentItem.setCheckState(CheckState.CHECKED);
-                       } else if (parentItem.isChildrenAllUnchecked()) {
-                               parentItem.setCheckState(CheckState.UNCHECKED);
-                       } else {
-                               parentItem.setCheckState(CheckState.GRAYED);
-                       }
-               }
-       }
-       
-       private void setInstallStateByChildren(Item parentItem) {
-               if (!parentItem.hasChildren()) {
-                       return;
-               } else {
-                       for (Item item : parentItem.getChildren()) {
-                               setInstallStateByChildren(item);
-                       }
-                       
-                       if (parentItem.isChildrenAllUpdate()) {
-                               parentItem.setInstallState(InstallState.UPDATE);
-                       } else if (parentItem.isChildrenAllUninstall()) {
-                               parentItem.setInstallState(InstallState.UNINSTALL);
-                       } else {
-                               parentItem.setInstallState(InstallState.INSTALL);
-                       }
-               }
-       }
-       
-       
-       /**
-        * check children's checkbox state.
-        * @return if true, children's checkbox state is all checked.
-        */
-       public boolean isChildrenAllChecked() {
-               for (Item item : getChildren()) {
-                       if (item.getCheckState() != CheckState.CHECKED) {
-                               return false;
-                       }
-               }
-               return true;
-       }
-       
-       /**
-        * check children's checkbox state.
-        * @return if true, children's checkbox state is all unchecked.
-        */
-       public boolean isChildrenAllUnchecked() {
-               for (Item item : getChildren()) {
-                       if (item.getCheckState() != CheckState.UNCHECKED) {
-                               return false;
-                       }
-               }
-               return true;
-       }
-       
-       private boolean isChildrenAllUpdate() {
-               for (Item item : getChildren()) {
-                       if (item.getInstallState() != InstallState.UPDATE) {
-                               return false;
-                       }
-               }
-               return true;
-       }
-       
-       private boolean isChildrenAllUninstall() {
-               for (Item item : getChildren()) {
-                       if (item.getInstallState() != InstallState.UNINSTALL) {
-                               return false;
-                       }
-               }
-               return true;
-       }
-       
-       public String getStateToString() {
-               if (hasChildren() || getParent() == null) {
-                       return "";
-               } else {
-                       switch(installState) {
-                       case INSTALL:
-                               return "Not installed";
-                       case UPDATE:
-                               return "Updatable";
-                       case UNINSTALL:
-                               return "Installed";
-                       default:
-                               return "";
-                       }
-               }
-       }
-
-       /**
-        * If parent item is checked, child items should be checked. 
-        * @param state is true, every child items' checked flag is true. false is the opposite. 
-        */
-       public void setSubItemChecked(boolean state) {
-               setCheckState(state);
-
-               if (hasChildren()) {
-                       for (int i = 0; i < getChildren().size(); i++) {
-                               ((Item) getChildren().get(i)).setSubItemChecked(state);
-                       }
-               }
-       }
-
-       /**
-        * Check the existing children and checked flag, add to installed package list.
-        * @param installList is packages list which is installed already.
-        * @param checked is true, checking in box on tree view. false is the opposite.
-        */
-       public void getTerminalPackages(List<String> installList, boolean checked) {
-               if (hasChildren()) {
-                       for (Item childItem : getChildren()) {
-                               childItem.getTerminalPackages(installList, checked);
-                       }
-               } 
-               
-               if (getChildren().size() <= 0) {
-                       if (getCheckState() == CheckState.CHECKED) {
-                               installList.add(getPackageName());
-                       }
-               }
-       }
-
-       /**
-        * Get child items list.
-        * @return child items list.
-        */
-       public List<Item> getDescendants() {
-               List<Item> descendants = new ArrayList<Item>();
-               descendants.add(this);
-               if (hasChildren()) {
-                       for (int i = 0; i < getChildren().size(); i++) {
-                               descendants.addAll(((Item) getChildren().get(i)).getDescendants());
-                       }
-               }
-               return descendants;
-       }
-       
-       public boolean hasGrayedChild(List<Item> grayCheckedItems) {
-               for (int i = 0; i < grayCheckedItems.size(); i++) {
-                       for (int j = 0; j < getChildren().size(); j++) {
-                               if (grayCheckedItems.get(i) == getChildren().get(j))
-                                       return true;
-                       }
-               }
-               return false;
-       }
-       
-       /**
-        * check children's checkbox state.
-        * @return if true, child item's checkbox state is grayed.
-        */
-       public boolean hasGrayedChild() {
-               for (Item item : getChildren()) {
-                       if (item.getCheckState() == CheckState.GRAYED) {
-                               return true;
-                       }
-               }
-               return false;
-       }
-
-       public void checkSuperItemGrayed(
-                       List<Item> grayCheckedItems, List<Item> checkedItems, List<Item> unCheckedItems) {
-               if (hasChildren()) {
-                       boolean isAllChecked = true;
-                       boolean isAllUnchecked = true;
-                       for (int i = 0; i < getChildren().size(); i++) {
-                               if (((Item) getChildren().get(i)).getCheckState() == CheckState.UNCHECKED)
-                                       isAllChecked = false;
-                               else
-                                       isAllUnchecked = false;
-                       }
-                       if (isAllChecked == false && isAllUnchecked == false || hasGrayedChild(grayCheckedItems) == true) {
-                               grayCheckedItems.add(this);
-//                             setChecked(true);
-                       } else if (isAllChecked == true && isAllUnchecked == false && hasGrayedChild(grayCheckedItems) == false) {
-                               checkedItems.add(this);
-                               setCheckState(CheckState.CHECKED);
-                       } else if (isAllChecked == false && isAllUnchecked == true && hasGrayedChild(grayCheckedItems) == false) {
-                               unCheckedItems.add(this);
-                               setCheckState(CheckState.UNCHECKED);
-                       }
-               }
-               if (getParent() != null) {
-                       getParent().checkSuperItemGrayed(grayCheckedItems, checkedItems, unCheckedItems);
-               }
-       }
-       
-       public String toString() {
-               return getPackageName();
-       }
-
-       @Override
-       public int compareTo(Item item) {
-               int order = item.getOrder();
-               if (order > getOrder()) {
-                       return -1;
-               } else if (order == getOrder()) {
-                       return 0;
-               } else if (order < getOrder()) {
-                       return 1;
-               }
-               return 0;
-       }
-}
diff --git a/SdkImageCreator/src/org/tizen/installmanager/ui/model/ItemLabelProvider.java b/SdkImageCreator/src/org/tizen/installmanager/ui/model/ItemLabelProvider.java
deleted file mode 100644 (file)
index f8a37bf..0000000
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
-*  InstallManager
-*
-* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
-*
-* Contact: 
-* Wooyoung Cho <wooyoung1.cho@samsung.com>
-* Shihyun Kim <shihyun.kim@samsung.com>
-* Taeyoung Son <taeyoung2.son@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.ui.model;
-
-
-import org.eclipse.jface.viewers.ColumnLabelProvider;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.jface.viewers.ViewerCell;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.widgets.Display;
-import org.tizen.installmanager.ui.model.Item.CheckState;
-import org.tizen.installmanager.ui.model.Item.InstallState;
-import org.tizen.installmanager.ui.page.PackageListPage;
-
-
-/**
- * This class provide the text and/or image for each column of a given element. Used by PackageListPage.
- * @see PackageListPage
- * @author Taeyoung Son <taeyoung2.son@samsung.com>
- */
-public class ItemLabelProvider extends ColumnLabelProvider {
-
-       @Override
-       public void addListener(ILabelProviderListener listener) {
-       }
-
-       @Override
-       public void dispose() {
-       }
-
-       @Override
-       public boolean isLabelProperty(Object element, String property) {
-               return false;
-       }
-
-       @Override
-       public void removeListener(ILabelProviderListener listener) {
-       }
-
-//     public String getToolTipText(Object element) {
-//             String description = "Tooltip (" + element + ")";
-//             if (element instanceof Item && viewController != null) {
-//                     String pkgName = ((Item) element).getPackageName();
-//                     description = viewController.getDescription(pkgName);
-//             }
-//
-//             return description;
-//     }
-       
-       public Point getToolTipShift(Object object) {
-               return new Point(5, 5);
-       }
-       
-       public int getToolTipTimeDisplyed(Object object) {
-               return 5000;
-       }
-       
-       public void update(ViewerCell cell) {
-               int columnIndex = cell.getColumnIndex();
-               Object element = cell.getElement();
-               String result = null;
-               switch (columnIndex) {
-               case 0:
-                       if (element instanceof Item) {
-                               result = ((Item) element).getDisplayName();
-                       }
-                       break;
-               case 1:
-                       if (element instanceof Item) {                          
-                               result = ((Item) element).getStateToString();
-                       }
-                       break;
-               case 2:
-                       if (element instanceof Item) {
-                               result = displaySize(element);
-                       }
-                       break;
-               case 3:
-                       if (element instanceof Item) {
-                               result = ((Item) element).getInstalledVersion();
-                       }
-                       break;
-               }
-
-               if (result != null) {
-                       cell.setText(result);
-               }
-               
-               if (element instanceof Item) {
-                       InstallState state = ((Item)element).getInstallState();
-                       if (state == InstallState.UPDATE || state == InstallState.UNINSTALL) {
-                               cell.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_GRAY));
-                       }
-               }
-       }
-       
-       private String displaySize(Object element) {
-               Item item = (Item) element;
-
-               if (item.getCheckState() == CheckState.UNCHECKED) {
-                       return "";
-               } else {
-                       return sizeToKB(item.getSize());
-               }
-       }
-
-       private String sizeToKB(Long size) {
-               if (size <= 0) {
-                       return "";
-               }
-               
-               double sizeB = (double)size;
-               double sizeK = sizeB / 1024.0;
-               double sizeM = sizeK / 1024.0;
-
-               String retSize = String.format("%.1f", sizeM) + "M";
-               if (retSize.equals("0.0M")) {
-                       retSize = String.format("%.1f", sizeK) + "K";
-               }
-
-               return retSize;
-       }
-}
\ No newline at end of file
diff --git a/SdkImageCreator/src/org/tizen/installmanager/ui/model/ItemTreeContentProvider.java b/SdkImageCreator/src/org/tizen/installmanager/ui/model/ItemTreeContentProvider.java
deleted file mode 100644 (file)
index f6056e6..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
-*  InstallManager
-*
-* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
-*
-* Contact: 
-* Wooyoung Cho <wooyoung1.cho@samsung.com>
-* Shihyun Kim <shihyun.kim@samsung.com>
-* Taeyoung Son <taeyoung2.son@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.ui.model;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-
-/**
- * an interface to content providers for tree-structure-oriented viewers.
- * @author Taeyoung Son <taeyoung2.son@samsung.com>
- */
-public class ItemTreeContentProvider implements ITreeContentProvider {
-       @Override
-       public void dispose() {
-       }
-
-       @Override
-       public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
-       }
-
-       @Override
-       public Object[] getElements(Object inputElement) {
-               ArrayList<Object> retElements = new ArrayList<Object>();
-               
-               if (inputElement instanceof List) {
-                       List<?> elementList = (List<?>)inputElement;
-                       
-                       for (Object obj : elementList) {
-                               if (obj instanceof Item) {
-                                       Item item = (Item)obj;
-                                       
-                                       if (item.getParent() == null) {
-                                               retElements.add(item);
-                                       }
-                               }
-                       }
-               }
-               
-               return retElements.toArray();
-       }
-
-       @Override
-       public Object[] getChildren(Object parentElement) {
-               if (parentElement instanceof Item) {
-                       return ((Item) parentElement).getChildren().toArray();
-               } else {
-                       return null;
-               }
-       }
-
-       @Override
-       public Object getParent(Object element) {
-               if (element instanceof Item) {
-                       return ((Item) element).getParent();
-               } else {
-                       return null;
-               }
-       }
-
-       @Override
-       public boolean hasChildren(Object element) {
-               if (element instanceof Item) {
-                       return ((Item) element).hasChildren();
-               } else {
-                       return false;
-               }
-       }
-}
\ No newline at end of file
diff --git a/SdkImageCreator/src/org/tizen/installmanager/ui/page/.gitignore b/SdkImageCreator/src/org/tizen/installmanager/ui/page/.gitignore
deleted file mode 100644 (file)
index 0536a1f..0000000
+++ /dev/null
@@ -1 +0,0 @@
-/PageTemplate.java
diff --git a/SdkImageCreator/src/org/tizen/installmanager/ui/page/CompletePage.java b/SdkImageCreator/src/org/tizen/installmanager/ui/page/CompletePage.java
deleted file mode 100644 (file)
index 7f17a1d..0000000
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
-*  InstallManager
-*
-* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
-*
-* Contact: 
-* Wooyoung Cho <wooyoung1.cho@samsung.com>
-* Shihyun Kim <shihyun.kim@samsung.com>
-* Taeyoung Son <taeyoung2.son@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.ui.page;
-
-import java.io.File;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.tizen.installmanager.core.Config;
-import org.tizen.installmanager.lib.Platform;
-import org.tizen.installmanager.ui.InstallManagerWindow;
-import org.tizen.installmanager.ui.dialog.MessageBoxDlg;
-import org.tizen.installmanager.ui.dialog.MessageBoxDlg.DialogType;
-import org.tizen.installmanager.util.PathUtil;
-
-
-/**
- * Complete Page class
- * @author Taeyoung Son <taeyoung2.son@samsung.com>
- */
-public class CompletePage extends PageTemplate {
-       public static final String RSC_PATH_INSTALL_IMAGE = RESOURCE_PATH + "/install_manager_graphicmotif_004.png";
-       public static final String RSC_PATH_UNINSTALL_IMAGE = RESOURCE_PATH + "/uninstaller_graphicmotif_003.png";
-       public static final String STRING_TITLE = "Installation Completed";
-       private Label lblNewLabel;
-       public Button checkBtn;
-
-       /**
-        * Set basic environment of complete page.
-        * @param parent
-        * @param style
-        */
-       public CompletePage(Composite parent, int style) {
-               super(parent, style);
-               setLeftImageFromResource(RSC_PATH_INSTALL_IMAGE);
-               setTitle(STRING_TITLE);
-
-               checkBtn = new Button(customComposite, SWT.CHECK);
-               checkBtn.setBackground(InstallManagerWindow.getBackgroundColor());
-               checkBtn.setText("Show Release Note.");
-               checkBtn.setLocation(10, 150);
-               checkBtn.pack();
-               checkBtn.setSelection(true);
-
-               lblNewLabel = new Label(customComposite, SWT.WRAP);
-               lblNewLabel.setBounds(10, 0, 400, 244);
-               lblNewLabel.setText("");
-               lblNewLabel.setBackground(InstallManagerWindow.getBackgroundColor());
-       }
-
-       public void loadPage() {
-       }
-
-       /**
-        * Get check button
-        * @return check button object
-        */
-       public Button getChkBtn() {
-               return checkBtn;
-       }
-
-       /**
-        * If bStatus is true, check button will be displayed. but false, check button will not be displayed.
-        * @param bStatus
-        */
-       public void showCheckButton(boolean bStatus) {
-               checkBtn.setSelection(false);
-               checkBtn.setVisible(bStatus);
-       }
-
-       /**
-        * Show message on complete page.
-        * @param completeMsg
-        */
-       public void setCustomMessage(String completeMsg) {
-               lblNewLabel.setText(completeMsg);
-       }
-       
-       public void removeTargetDir() {
-               String targetDir = Config.getInstance().getTargetDir();
-               if (targetDir == null || targetDir.isEmpty()) {
-                       return;
-               } 
-               
-               File targetDirFile = new File(targetDir);
-               if (!targetDirFile.exists()) {
-                       return;
-               } else {
-                       if (!Platform.isWindows()) {
-                               int confirm = MessageBoxDlg.showDlg(getShell(), 
-                                           "WARNING", 
-                                           "Do you want to remove the SDK directory?\n" + 
-                                           "Your data files in '" + 
-                                               targetDir + 
-                                           "' will be removed too.", 
-                                           DialogType.WARNING, false);
-                               if (confirm == MessageBoxDlg.YES) {                             
-                                       PathUtil.remove(targetDir);
-                               } else {}
-                       } else {}//if(Patform.isWindows())
-               }
-       }
-
-       /**
-        * Show error message on complete page.
-        * @param errorMsg
-        */
-       public void setCustomErrorMessage(String errorMsg) {
-               lblNewLabel.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_DARK_RED));
-               lblNewLabel.setText(errorMsg);
-       }
-}
diff --git a/SdkImageCreator/src/org/tizen/installmanager/ui/page/ConfigPathPage.java b/SdkImageCreator/src/org/tizen/installmanager/ui/page/ConfigPathPage.java
deleted file mode 100644 (file)
index eaf3bf8..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
-*  InstallManager
-*
-* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
-*
-* Contact: 
-* Wooyoung Cho <wooyoung1.cho@samsung.com>
-* Shihyun Kim <shihyun.kim@samsung.com>
-* Taeyoung Son <taeyoung2.son@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.ui.page;
-
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.jface.viewers.TableViewerColumn;
-
-/**
- * ConfigPath Page class
- * @author Taeyoung Son <taeyoung2.son@samsung.com>
- */
-public class ConfigPathPage extends PageTemplate {
-       private static final String RSC_PATH_IMAGE = RESOURCE_PATH + "/install_manager_graphicmotif_003.png";
-       private static final String STRING_TITLE = "Install";
-       private static final String STRING_SUBTITLE = "Select the package installation and update location.";
-
-       private Table table;
-
-       /**
-        * @param parent
-        * @param style
-        */
-       public ConfigPathPage(Composite parent, int style) {
-               super(parent, style);
-               setLeftImageFromResource(RSC_PATH_IMAGE);
-               setTitle(STRING_TITLE);
-               setSubTitle(STRING_SUBTITLE);
-
-               TableViewer tableViewer = new TableViewer(customComposite, SWT.BORDER | SWT.FULL_SELECTION);
-               table = tableViewer.getTable();
-               table.setBounds(0, 0, 468, 145);
-
-               TableViewerColumn tableViewerColumn = new TableViewerColumn(tableViewer, SWT.NONE);
-               TableColumn tblclmnName = tableViewerColumn.getColumn();
-               tblclmnName.setWidth(60);
-               tblclmnName.setText("Name");
-
-               TableViewerColumn tableViewerColumn_1 = new TableViewerColumn(tableViewer, SWT.NONE);
-               TableColumn tblclmnLatestVer = tableViewerColumn_1.getColumn();
-               tblclmnLatestVer.setWidth(60);
-               tblclmnLatestVer.setText("Latest Ver.");
-
-               TableViewerColumn tableViewerColumn_2 = new TableViewerColumn(tableViewer, SWT.NONE);
-               TableColumn tblclmnInstalledVer = tableViewerColumn_2.getColumn();
-               tblclmnInstalledVer.setWidth(60);
-               tblclmnInstalledVer.setText("Installed Ver.");
-
-               TableViewerColumn tableViewerColumn_3 = new TableViewerColumn(tableViewer, SWT.NONE);
-               TableColumn tblclmnSize = tableViewerColumn_3.getColumn();
-               tblclmnSize.setWidth(60);
-               tblclmnSize.setText("Size");
-
-               TableViewerColumn tableViewerColumn_4 = new TableViewerColumn(tableViewer, SWT.NONE);
-               TableColumn tblclmnDescription = tableViewerColumn_4.getColumn();
-               tblclmnDescription.setWidth(100);
-               tblclmnDescription.setText("Description");
-       }
-}
diff --git a/SdkImageCreator/src/org/tizen/installmanager/ui/page/InstallableListPage.java b/SdkImageCreator/src/org/tizen/installmanager/ui/page/InstallableListPage.java
deleted file mode 100644 (file)
index c480caf..0000000
+++ /dev/null
@@ -1,330 +0,0 @@
-/*
- *  InstallManager
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: 
- * Wooyoung Cho <wooyoung1.cho@samsung.com>
- * Shihyun Kim <shihyun.kim@samsung.com>
- * Taeyoung Son <taeyoung2.son@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.ui.page;
-
-import java.util.ArrayList;
-import java.util.Collection;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.tizen.installmanager.core.IMFatalException;
-import org.tizen.installmanager.core.InstallManager;
-import org.tizen.installmanager.core.SDKExtensionInfo;
-import org.tizen.installmanager.lib.ErrorController;
-import org.tizen.installmanager.lib.IMError;
-import org.tizen.installmanager.lib.Log;
-import org.tizen.installmanager.ui.InstallManagerWindow;
-import org.tizen.installmanager.ui.model.Item;
-import org.tizen.installmanager.pkg.lib.PackageManager;
-import org.tizen.installmanager.pkg.model.Package;
-
-/**
- * This class displays installable package list on page.
- * 
- * @author Yongsung Kim <yongsung1.kim@samsung.com>
- */
-public class InstallableListPage extends PackageListPage {
-
-       static final String RSC_PATH_IMAGE = RESOURCE_PATH
-                       + "/install_manager_graphicmotif_002.png";
-       static final String STRING_TITLE = "Install Type";
-
-       static final String TYPICAL_BUTTON_NAME = "Typical";
-       static final String MINIMAL_BUTTON_NAME = "Minimal";
-       static final String CUSTOM_BUTTON_NAME = "Custom";
-
-       private Composite buttonComposite;
-
-       // Install Type button
-       private Button typicalButton;
-       private Button minimalButton;
-       private Button customButton;
-
-       // Install Type Explain Label
-       private Label typicalLabel;
-       private Label minimalLabel;
-
-       /**
-        * @param parent
-        * @param style
-        */
-       public InstallableListPage(Composite parent, int style) {
-               super(parent, style, Type.INSTALL);
-               setLeftImageFromResource(RSC_PATH_IMAGE);
-               setTitleBounds(160, 3, 468, 20);
-               disableSubtitleBounds();
-               setTitle(STRING_TITLE);
-
-               buttonComposite = new Composite(this, SWT.NONE);
-
-               buttonComposite.setSize(468, 60);
-               buttonComposite.setLocation(160, 27);
-               buttonComposite
-                               .setBackground(InstallManagerWindow.getBackgroundColor());
-
-               setButtons();
-       }
-
-       /**
-        * Set Install Type radio buttons.
-        */
-       private void setButtons() {
-               setTypicalButton();
-               setMinimalButton();
-               setCustomButton();
-       }
-
-       /**
-        * Set Typical Type radio button.
-        */
-       private void setTypicalButton() {
-               if (typicalButton == null) {
-                       typicalButton = new Button(buttonComposite, SWT.RADIO);
-               }
-
-               typicalButton.setSelection(true);
-
-               typicalButton.addSelectionListener(new SelectionAdapter() {
-                       @Override
-                       public void widgetSelected(SelectionEvent e) {
-                               setCheckedByType(TYPICAL_BUTTON_NAME.toUpperCase());
-                               checkboxTreeViewer.refresh();
-                               checkboxTreeViewer.getTree().setEnabled(false);
-
-                               lblRequiredSize.setText("Total space required : "
-                                               + convertToVolumeSize(getCheckedPackageSize()));
-                               
-                               setNextBtnEnabledAboutCheckedPackageCount();
-                       }
-               });
-
-               typicalButton.setBounds(0, 0, 80, 15);
-               typicalButton.setText(TYPICAL_BUTTON_NAME + ":");
-               typicalButton.setBackground(InstallManagerWindow.getBackgroundColor());
-
-               typicalLabel = new Label(buttonComposite, SWT.NONE);
-               typicalLabel.setBounds(81, 0, 410, 15);
-       }
-
-       /**
-        * Set Minimal Type radio button.
-        */
-       private void setMinimalButton() {
-               if (minimalButton == null) {
-                       minimalButton = new Button(buttonComposite, SWT.RADIO);
-               }
-
-               minimalButton.addSelectionListener(new SelectionAdapter() {
-                       @Override
-                       public void widgetSelected(SelectionEvent e) {
-                               setCheckedByType(MINIMAL_BUTTON_NAME.toUpperCase());
-                               checkboxTreeViewer.refresh();
-                               checkboxTreeViewer.getTree().setEnabled(false);
-
-                               lblRequiredSize.setText("Total space required : "
-                                               + convertToVolumeSize(getCheckedPackageSize()));
-                               
-                               setNextBtnEnabledAboutCheckedPackageCount();
-                       }
-               });
-
-               minimalButton.setBounds(0, 20, 80, 15);
-               minimalButton.setText(MINIMAL_BUTTON_NAME + ":");
-               minimalButton.setBackground(InstallManagerWindow.getBackgroundColor());
-
-               minimalLabel = new Label(buttonComposite, SWT.NONE);
-               minimalLabel.setBounds(81, 20, 410, 15);
-       }
-
-       /**
-        * Set Custom Type radio button.
-        */
-       private void setCustomButton() {
-               if (customButton == null) {
-                       customButton = new Button(buttonComposite, SWT.RADIO);
-               }
-
-               customButton.setBounds(0, 40, 80, 15);
-               customButton.setText(CUSTOM_BUTTON_NAME);
-               customButton.setBackground(InstallManagerWindow.getBackgroundColor());
-
-               customButton.addSelectionListener(new SelectionAdapter() {
-                       @Override
-                       public void widgetSelected(SelectionEvent e) {
-                               checkboxTreeViewer.getTree().setEnabled(true);
-                       }
-               });
-       }
-
-       /**
-        * Check tree item by each install type.
-        */
-       private void setCheckedByType(String installType) {
-               if (installType == null || installType.isEmpty()) {
-                       Log.err("Install type is empty. check install type or package server is old.");
-               }
-               Package pkg = InstallManager.getInstance().getPackageManager()
-                               .getPackageByName(installType);
-
-               if (pkg == null) {
-                       Log.err(installType + " do not exist in package list.");
-                       return;
-               }
-
-               Collection<Item> checkedItems = new ArrayList<Item>();
-
-               for (String pkgName : pkg.getDependentPackageNames()) {
-                       Item item = findItem(pkgName, items);
-
-                       if (item != null) {
-                               checkedItems.add(item);
-                       }
-               }
-
-               setCheckedItem(checkedItems);
-       }
-
-       private void setCheckedItem(Collection<Item> itemList) {
-               checkboxTreeViewer.setCheckedElements(itemList.toArray());
-
-               // refresh tree item. All of items are unchecked.
-               setAllChecked(false);
-
-               // check selected item.
-               for (Item item : itemList) {
-                       setCheckbox(item, true);
-               }
-       }
-
-       /**
-        * Display installable package list from view controller.
-        */
-       public boolean loadPage(ViewController controller) {
-               this.viewController = controller;
-               getItems().clear();
-
-               // back to next on component selection page case.
-               // in this case, page status should be typical selection case.
-               if (customButton.getSelection()) {
-                       customButton.setSelection(false);
-                       typicalButton.setSelection(true);
-               } else if (minimalButton.getSelection()) {
-                       minimalButton.setSelection(false);
-                       typicalButton.setSelection(true);
-               }
-
-               try {
-                       loadPackagesToTreeViewer(viewController.getRootMetaPackageListOfRepository());
-
-                       SDKExtensionInfo sdkExtensionInfo = SDKExtensionInfo.getInstance();
-                       addExtensionPackagesToExtra(sdkExtensionInfo.getExtensionPackages());
-               } catch (IMFatalException fatalException) {
-                       Log.err(ErrorController.getErrorMessage());
-                       IMError.fatalError(ErrorController.getErrorMessage());
-               }
-
-               checkboxTreeViewer.refresh();
-
-               if (getItems().size() <= 0) {
-                       return false;
-               }
-
-               setCheckedByType(TYPICAL_BUTTON_NAME.toUpperCase());
-               checkboxTreeViewer.getTree().setEnabled(false);
-
-               checkboxTreeViewer.refresh();
-
-               setNextBtnEnabledAboutCheckedPackageCount();
-               lblRequiredSize.setText("Total space required : "
-                               + convertToVolumeSize(getCheckedPackageSize()));
-               
-               initDescriptionToInstallType();
-
-               return true;
-       }
-       
-       private void initDescriptionToInstallType() {
-               PackageManager pm = PackageManager.getInstance();
-               
-               //set typical description
-               String typicalExplain = "";
-               Package typicalPackage = pm.getPackageByName(TYPICAL_BUTTON_NAME.toUpperCase());
-               if (typicalPackage != null) {
-                       typicalExplain = typicalPackage.getDescription();
-               }
-               
-               typicalLabel.setText(typicalExplain);
-               typicalLabel.setBackground(InstallManagerWindow.getBackgroundColor());
-               
-               //set minimal description               
-               String minimalExplain = "";
-               Package minimalPackage = pm.getPackageByName(MINIMAL_BUTTON_NAME.toUpperCase());
-               if (minimalPackage != null) {
-                       minimalExplain = minimalPackage.getDescription();
-               }
-               
-               minimalLabel.setText(minimalExplain);
-               minimalLabel.setBackground(InstallManagerWindow.getBackgroundColor());
-       }
-
-       /**
-        * Find item which should be checked in component tree.
-        * 
-        * @param name
-        *            the name of item which should be checked.
-        * @param itemList
-        * @return item which should be checked in component tree.
-        */
-       private Item findItem(String name, Collection<Item> itemList) {
-               Item retItem = null;
-               for (Item item : itemList) {
-                       if (name.equalsIgnoreCase(item.getPackageName())) {
-                               return item;
-                       } else {
-                               Collection<Item> childItemList = item.getChildren();
-
-                               if (childItemList.size() > 0) {
-                                       retItem = findItem(name, childItemList);
-
-                                       if (retItem != null) {
-                                               break;
-                                       }
-                               }
-                       }
-               }
-               return retItem;
-       }
-}
-
-
-
diff --git a/SdkImageCreator/src/org/tizen/installmanager/ui/page/InstallingPage.java b/SdkImageCreator/src/org/tizen/installmanager/ui/page/InstallingPage.java
deleted file mode 100644 (file)
index 48ed9bd..0000000
+++ /dev/null
@@ -1,591 +0,0 @@
-/*
-*  InstallManager
-*
-* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
-*
-* Contact: 
-* Wooyoung Cho <wooyoung1.cho@samsung.com>
-* Shihyun Kim <shihyun.kim@samsung.com>
-* Taeyoung Son <taeyoung2.son@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.ui.page;
-
-import java.text.DecimalFormat;
-import java.util.List;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.ProgressBar;
-import org.tizen.installmanager.core.IMExitException;
-import org.tizen.installmanager.core.IMFatalException;
-import org.tizen.installmanager.core.IMInstallCancelException;
-import org.tizen.installmanager.lib.ErrorController;
-import org.tizen.installmanager.lib.IIMProgressMonitor;
-import org.tizen.installmanager.lib.Log;
-import org.tizen.installmanager.lib.Platform;
-import org.tizen.installmanager.lib.ProgramController;
-import org.tizen.installmanager.lib.ErrorController.ErrorCode;
-import org.tizen.installmanager.ui.InstallManagerWindow;
-import org.tizen.installmanager.ui.dialog.MessageBoxDlg;
-import org.tizen.installmanager.ui.dialog.MessageBoxDlg.DialogType;
-
-/**
- * @author Taeyoung Son <taeyoung2.son@samsung.com>
- * 
- */
-public class InstallingPage extends PageTemplate {
-       static final String RSC_PATH_IMAGE = RESOURCE_PATH
-                       + "/install_manager_graphicmotif_003.png";
-       static final String STRING_TITLE = "Installation Progress";
-       static final String STRING_SUBTITLE = "Wait while the Tizen SDK installation is being processed.";
-
-       static final double KB_SIZE = 1;
-       static final double MB_SIZE = KB_SIZE * 1024;
-       static final double GB_SIZE = MB_SIZE * 1024;
-
-       static final int SEC = 1;
-       static final int MIN = SEC * 60;
-       static final int HOUR = MIN * 60;
-       static final int DAY = HOUR * 24;
-
-       private static String totalSize;
-       private static String currentSize;
-
-       private List<String> selectedList;
-       private ProgressBar progressBar;
-       private Label statusLabel;
-       private Label mSubTitleOfProgress;
-       private Label installedNumberLabel;
-       private Label mDownloadVelocity;
-
-       private ViewController viewController;
-       private String installPath;
-       private InstallProgressMonitor monitor;
-       private InstallManagerWindow mainWindow;
-       Display display;
-
-       /**
-        * Set basic environment of installing page.
-        * @param parent
-        * @param style
-        */
-       public InstallingPage(Composite parent, int style) {
-               super(parent, style);
-
-               setLeftImageFromResource(RSC_PATH_IMAGE);
-               setTitle(STRING_TITLE);
-               setSubTitle(STRING_SUBTITLE);
-
-               progressBar = new ProgressBar(customComposite, SWT.NONE);
-               progressBar.setBounds(30, 110, 406, 20);
-
-               statusLabel = new Label(customComposite, SWT.NONE);
-               statusLabel.setBounds(30, 65, 340, 23);
-               statusLabel.setBackground(InstallManagerWindow.getBackgroundColor());
-
-               mSubTitleOfProgress = new Label(customComposite, SWT.NONE);
-               mSubTitleOfProgress.setBounds(30, 138, 260, 23);
-               mSubTitleOfProgress.setForeground(new Color(null, 96, 96, 96));
-               mSubTitleOfProgress
-                               .setBackground(InstallManagerWindow.getBackgroundColor());
-               mSubTitleOfProgress.setText("");
-
-               installedNumberLabel = new Label(customComposite, SWT.NONE);
-               installedNumberLabel.setAlignment(SWT.RIGHT);
-               installedNumberLabel.setBounds(275, 90, 160, 23);
-               installedNumberLabel.setForeground(new Color(null, 0, 108, 209));
-               installedNumberLabel
-                               .setBackground(InstallManagerWindow.getBackgroundColor());
-               installedNumberLabel.setText("");
-
-               mDownloadVelocity = new Label(customComposite, SWT.NONE);
-               mDownloadVelocity.setAlignment(SWT.RIGHT);
-               mDownloadVelocity.setBounds(295, 138, 140, 23);
-               mDownloadVelocity.setBackground(InstallManagerWindow.getBackgroundColor());
-               mDownloadVelocity.setForeground(new Color(null, 0, 108, 209));
-               mDownloadVelocity.setText("");
-       }
-
-       /**
-        * First of all this function check package whether update or not and check install path(target directory)
-        * is empty. 
-        * @param selectedList
-        * @param viewController
-        * @param installPath
-        * @param mainWindow
-        * @param isUpdate
-        * @return true is success to install<br>false is fail to install
-        */
-       public boolean loadPage(List<String> selectedList,
-                       ViewController viewController, String installPath,
-                       InstallManagerWindow mainWindow, boolean isUpdate) {
-               this.selectedList = selectedList;
-               this.viewController = viewController;
-               this.installPath = installPath;
-               this.mainWindow = mainWindow;
-               monitor = new InstallProgressMonitor();
-               display = customComposite.getDisplay();
-
-               if (isUpdate == true) {
-                       ProgramController controller = ProgramController
-                                       .createProgramController();
-                       
-                       if (controller.runningProgramExists()) {
-                               int confirm = MessageBoxDlg
-                                               .showDlg(
-                                                               getShell(),
-                                                               "Warning",
-                                                               "SDK is running. If you update the SDK, the running SDK version is stopped. Are you sure you want to update the SDK?",
-                                                               DialogType.WARNING, false);
-                               if (confirm == MessageBoxDlg.YES) {
-                                       controller.terminateRunningProgram();
-                               } else if (confirm == MessageBoxDlg.NO) {
-                                       return false;
-                               }
-                       }
-               } else {}
-               
-               new InstallThread(monitor).start();
-               
-               return true;
-       }
-
-       /**
-        * This class controls process to install.
-        * @author Shihyun Kim <shihyun.kim@samsung.com>
-        */
-       class InstallThread extends Thread {
-
-               private InstallProgressMonitor monitor;
-
-               public InstallThread(InstallProgressMonitor monitor) {
-                       this.monitor = monitor;
-               }
-
-               /**
-                * Installing thread run
-                */
-               @Override
-               public void run() {
-                       try {
-                               installProcess(monitor);
-                               ErrorController.setInstallationSuccess(true);
-                       } catch (IMFatalException e) {
-                               Log.err("internal error occurred");
-                               Log.ExceptionLog(e);
-                               ErrorController.setInstallationSuccess(false);
-                       } catch (Exception e) {
-                               Log.err("Unexpected exception occurred");
-                               Log.ExceptionLog(e);
-                               ErrorController.setInstallationSuccess(false);
-                       } finally {
-                               monitor.done();
-                       }
-                       Log.log("finish install thread");
-               }
-       }
-
-       /**
-        * After set selected package list and install path, start to install.
-        * @param monitor
-        * @throws IMExitException 
-        */
-       public void installProcess(InstallProgressMonitor monitor) throws IMExitException {
-               boolean bResult = false;
-
-               try {
-                       bResult = viewController.install(selectedList, installPath, monitor);
-                       ErrorController.setError(ErrorCode.INSTALLATION_FAIL);
-               } catch (IMInstallCancelException e) {
-                       bResult = false;
-                       ErrorController.setError(ErrorCode.INSTALL_CANCELED);
-                       Log.log("Installation canceled");
-               }
-
-               ErrorController.setInstallationSuccess(bResult);
-       }
-
-       /**
-        * Get install progress monitor object
-        * @return install progress monitor object
-        */
-       public InstallProgressMonitor getInstallProgressMonitor() {
-               return monitor;
-       }
-
-       /**
-        * @author Shihyun Kim <shihyun.kim@samsung.com>
-        */
-       public class InstallProgressMonitor implements IIMProgressMonitor {
-
-               private long totalWork;
-               private double mProgressSize = 0;
-               private String mProgressTitle;
-               private String mSubTitle;
-               private String status;
-               private long downloadStartTime = 0;
-               private boolean isCanceled = false;
-
-               private final int MAX_LENGTH = 40;
-               private final String STRING_ETC = "...";
-               private boolean cancelRequested;
-
-               /**
-                * Set start time to download.
-                */
-               public void setDownloadStartTime(long startTime) {
-                       this.downloadStartTime = startTime;
-               }
-
-               @Override
-               public void beginTask(String name, int totalWork) {
-                       if (display == null || display.isDisposed()) {
-                               setCanceled(true);
-                               return;
-                       }
-                       this.totalWork = totalWork;
-                       this.status = name;
-                       display.asyncExec(new Runnable() {
-                               @Override
-                               public void run() {
-                                       statusLabel.setText(status);
-                                       downloadStartTime = System.currentTimeMillis();
-                               }
-                       });
-               }
-
-               private boolean retContinue = false;
-
-               /**
-                * Check cancel button
-                * @return
-                * true : user press a cancel button
-                * false : user do nothing
-                */
-               public boolean checkCancelAndDisableCancelButton() {
-                       retContinue = false;
-                       if (display == null || display.isDisposed()) {
-                               setCanceled(true);
-                               return false;
-                       }
-                       display.syncExec(new Runnable() {
-                               @Override
-                               public void run() {
-                                       if (!cancelRequested) {
-                                               mainWindow.setCancelBtnEnabled(false);
-                                               mDownloadVelocity.setVisible(false);
-                                               mSubTitleOfProgress.setBounds(30, 138, 360, 23);
-                                               retContinue = true;
-                                       }
-                               }
-                       });
-                       return retContinue;
-               }
-
-               /**
-                * Control to finish install process
-                */
-               @Override
-               public void done() {
-                       if (display == null || display.isDisposed()) {
-                               setCanceled(true);
-                               return;
-                       }
-                       display.asyncExec(new Runnable() {
-                               @Override
-                               public void run() {
-                                       progressBar.setSelection(100);
-
-                                       CompletePage completePage = mainWindow.getCompletePage();
-                                       if (ErrorController.checkInstallationSuccess()) {
-                                               completePage.setTitle("Installation Completed");
-
-                                               if (Platform.CURRENT_PLATFORM == Platform.LINUX_32
-                                                               || Platform.CURRENT_PLATFORM == Platform.LINUX_64) {
-                                                       completePage
-                                                                       .setCustomMessage("Thank you for installing the Tizen SDK. \n\n" +
-                                                                                       "To use the SDK, go to Application > Tizen SDK > Tizen IDE.");
-                                               } else if (Platform.CURRENT_PLATFORM == Platform.WINDOWS_32
-                                                               || Platform.CURRENT_PLATFORM == Platform.WINDOWS_64) {
-                                                       completePage
-                                                                       .setCustomMessage("Thank you for installing the Tizen SDK. \n\n" +
-                                                                                       "To use the SDK, go to Start > All Programs > Tizen SDK > Tizen IDE.");
-                                               } else {
-                                                       completePage
-                                                       .setCustomMessage("Thank you for installing the Tizen SDK. \n\n");
-                                               }
-                                               Log.log("installation complete");
-                                       } else {
-                                               Log.log("(un)installation failed");
-                                               completePage.setTitle("(Un)Installation failed");
-                                               completePage.setCustomErrorMessage(ErrorController.getErrorMessage() + "\n");
-                                               mainWindow.getCompletePage().showCheckButton(false);
-                                       }
-
-                                       mainWindow.setCancelBtnEnabled(true);
-                                       mainWindow.showComposite(completePage);
-
-                               }
-                       });
-               }
-
-               @Override
-               public void internalWorked(double work) {
-                       // Do nothing.
-               }
-
-               @Override
-               public boolean isCanceled() {
-                       return isCanceled;
-               }
-
-               @Override
-               public void setCanceled(boolean value) {
-                       isCanceled = value;
-               }
-
-               @Override
-               public void setTaskName(String name) {
-                       // Do nothing.
-               }
-
-               @Override
-               public void subTask(String name) {
-                       // Do nothing.
-               }
-
-               @Override
-               public void setPackageName(String name) {
-                       mProgressTitle = name;
-               }
-
-               @Override
-               public void setFileName(String name) {
-                       if (name.length() > MAX_LENGTH) {
-                               mSubTitle = name.substring(0, MAX_LENGTH - 2);
-                               mSubTitle = mSubTitle + STRING_ETC;
-                       } else {
-                               mSubTitle = name;
-                       }
-               }
-
-               /**
-                * set working package name to show during installing
-                */
-               @Override
-               public void worked(final int work) {
-                       if (display == null || display.isDisposed()) {
-                               setCanceled(true);
-                               return;
-                       }
-                       display.asyncExec(new Runnable() {
-                               @Override
-                               public void run() {
-                                       statusLabel.setText("Processing : package \""
-                                                       + mProgressTitle + "\"");
-                                       installedNumberLabel.setText(work + "/" + (totalWork));
-                                       progressBar.setSelection(100 * work / (int) totalWork);
-                               }
-                       });
-               }
-
-               /**
-                * set working file name to show during installing 
-                */
-               @Override
-               public void workedFileName() {
-                       if (display == null || display.isDisposed()) {
-                               setCanceled(true);
-                               return;
-                       }
-                       display.asyncExec(new Runnable() {
-                               @Override
-                               public void run() {
-                                       mSubTitleOfProgress.setText(mSubTitle);
-                               }
-                       });
-               }
-
-               /**
-                * check validation of download
-                */
-               public void workedChecksum(final long size) {
-                       if (display == null || display.isDisposed()) {
-                               setCanceled(true);
-                               return;
-                       }
-                       display.asyncExec(new Runnable() {
-                               private String pattern = ".##";
-                               private DecimalFormat dformat = new DecimalFormat(pattern);
-
-                               public void run() {
-                                       /* set total size */
-                                       mProgressSize += size / (double) 1024;
-                                       if (totalWork >= GB_SIZE)
-                                               totalSize = dformat.format((totalWork / GB_SIZE))
-                                                               + "GB";
-                                       else if (totalWork >= MB_SIZE)
-                                               totalSize = dformat.format((totalWork / MB_SIZE))
-                                                               + "MB";
-                                       else
-                                               totalSize = totalWork + "KB";
-
-                                       /* set current download size */
-                                       if (mProgressSize >= GB_SIZE)
-                                               currentSize = dformat.format((mProgressSize / GB_SIZE))
-                                                               + "GB";
-                                       else if (mProgressSize >= MB_SIZE)
-                                               currentSize = dformat.format((mProgressSize / MB_SIZE))
-                                                               + "MB";
-                                       else
-                                               currentSize = dformat.format(mProgressSize) + "KB";
-
-                                       statusLabel.setText("File checking : " + mProgressTitle);
-                                       installedNumberLabel.setText(currentSize + "/" + totalSize);
-                                       mSubTitleOfProgress.setText("");
-                                       mDownloadVelocity.setText("");
-                                       progressBar
-                                                       .setSelection((int) (100 * mProgressSize / totalWork));
-
-                               }
-                       });
-               }
-
-               /**
-                * Control download and show download information.
-                */
-               @Override
-               public void workedDownload(final long size) {
-                       if (display == null || display.isDisposed()) {
-                               setCanceled(true);
-                               return;
-                       }
-                       display.asyncExec(new Runnable() {
-                               private String pattern = ".00";
-                               private DecimalFormat dformat = new DecimalFormat(pattern);
-                               private String remainTimeStr = "";
-                               private String downloadVelocityStr = "";
-
-                               @Override
-                               public void run() {
-                                       /* set total size */
-                                       mProgressSize += size / (double) 1024;
-                                       if (totalWork >= GB_SIZE)
-                                               totalSize = dformat.format((totalWork / GB_SIZE))
-                                                               + "GB";
-                                       else if (totalWork >= MB_SIZE)
-                                               totalSize = dformat.format((totalWork / MB_SIZE))
-                                                               + "MB";
-                                       else
-                                               totalSize = totalWork + "KB";
-
-                                       /* set current download size */
-                                       if (mProgressSize >= GB_SIZE)
-                                               currentSize = dformat.format((mProgressSize / GB_SIZE))
-                                                               + "GB";
-                                       else if (mProgressSize >= MB_SIZE)
-                                               currentSize = dformat.format((mProgressSize / MB_SIZE))
-                                                               + "MB";
-                                       else
-                                               currentSize = dformat.format(mProgressSize) + "KB";
-
-                                       long pastTimes = System.currentTimeMillis()
-                                                       - downloadStartTime;
-
-                                       /* set download velocity */
-
-                                       double downloadVelocity = 0;
-
-                                       if (pastTimes > 5000) {
-                                               downloadVelocity = mProgressSize
-                                                               / (double) (pastTimes / (double) 1000);
-                                               if (downloadVelocity >= GB_SIZE)
-                                                       downloadVelocityStr = dformat
-                                                                       .format(downloadVelocity / GB_SIZE)
-                                                                       + "GB/s";
-                                               else if (downloadVelocity >= MB_SIZE)
-                                                       downloadVelocityStr = dformat
-                                                                       .format(downloadVelocity / MB_SIZE)
-                                                                       + "MB/s";
-                                               else
-                                                       downloadVelocityStr = dformat
-                                                                       .format(downloadVelocity / KB_SIZE)
-                                                                       + "KB/s";
-                                       }
-                                       /* set remain time */
-                                       double remainTime = 0;
-                                       if (downloadVelocity == 0)
-                                               remainTimeStr = "estimating..";
-                                       else {
-                                               double remainSize = totalWork - mProgressSize;
-                                               remainTime = remainSize / downloadVelocity;
-                                               int day = (int) (remainTime / DAY);
-                                               int hour = (int) ((remainTime % DAY) / HOUR);
-                                               int min = (int) ((remainTime % HOUR) / MIN);
-                                               int sec = (int) (remainTime % MIN);
-
-                                               if (day > 0)
-                                                       remainTimeStr = day + "day ";
-                                               if (hour > 0)
-                                                       remainTimeStr += hour + "hour ";
-                                               if (min > 0)
-                                                       remainTimeStr += min + "min ";
-                                               if (sec > 0)
-                                                       remainTimeStr += sec + "sec";
-                                       }
-
-                                       statusLabel.setText("Downloading : " + mProgressTitle);
-                                       installedNumberLabel.setText(currentSize + "/" + totalSize);
-                                       mSubTitleOfProgress.setText("Remaining time : "
-                                                       + remainTimeStr);
-                                       mDownloadVelocity.setText(downloadVelocityStr);
-                                       progressBar
-                                                       .setSelection((int) (100 * mProgressSize / totalWork));
-                               }
-                       });
-               }
-
-
-               /**
-                * Show percentage for progress bar
-                */
-               @Override
-               public void workedProgressbar(final int percent) {
-                       if (display == null || display.isDisposed()) {
-                               setCanceled(true);
-                               return;
-                       }
-                       display.asyncExec(new Runnable() {
-                               @Override
-                               public void run() {
-                                       progressBar.setSelection(percent);
-                               }
-                       });
-               }
-
-               public void setCancelRequested(boolean b) {
-                       cancelRequested = b;
-               }
-       }
-}
diff --git a/SdkImageCreator/src/org/tizen/installmanager/ui/page/LicensePage.java b/SdkImageCreator/src/org/tizen/installmanager/ui/page/LicensePage.java
deleted file mode 100644 (file)
index 66d45af..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
-*  InstallManager
-*
-* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
-*
-* Contact: 
-* Wooyoung Cho <wooyoung1.cho@samsung.com>
-* Shihyun Kim <shihyun.kim@samsung.com>
-* Taeyoung Son <taeyoung2.son@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.ui.page;
-
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.StyledText;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.tizen.installmanager.ui.InstallManagerWindow;
-import org.tizen.installmanager.util.PathUtil;
-
-
-/**
- * @author Taeyoung Son <taeyoung2.son@samsung.com>
- *
- */
-public class LicensePage extends PageTemplate {
-       private static final String RSC_PATH_IMAGE = RESOURCE_PATH + "/install_manager_graphicmotif_001.png";
-       private static final String STRING_TITLE = "License Agreement";
-       private static final String STRING_SUBTITLE = "To continue, accept the terms of this agreement.";
-
-       private StyledText txtLicense;
-       private Button btnAccept;
-
-       /**
-        * Set basic environment of license page.
-        * @param parent
-        * @param style
-        */
-       public LicensePage(Composite parent, int style) {
-               super(parent, style);
-
-               setLeftImageFromResource(RSC_PATH_IMAGE);
-               setTitle(STRING_TITLE);
-               setSubTitle(STRING_SUBTITLE);
-
-               txtLicense = new StyledText(
-                               customComposite, SWT.BORDER | SWT.READ_ONLY | SWT.WRAP | SWT.V_SCROLL | SWT.MULTI);
-               txtLicense.setBounds(0, 0, 437, 264);
-
-               btnAccept = new Button(customComposite, SWT.CHECK);
-               btnAccept.setBounds(7, 275, 428, 22);
-               btnAccept.setSelection(false);
-               btnAccept.setText("I accept the terms of this agreement.");
-               btnAccept.setBackground(InstallManagerWindow.getBackgroundColor());
-
-               String txt = PathUtil.readAllTextFromResource("/res/COPYING");
-               txtLicense.setText(txt);
-               txtLicense.setLineAlignment(1, 1, SWT.CENTER);
-       }
-
-       /**
-        * Get accept button object
-        * @return accept button object
-        */
-       public Button getAcceptButton() {
-               return btnAccept;
-       }
-}
diff --git a/SdkImageCreator/src/org/tizen/installmanager/ui/page/PackageListPage.java b/SdkImageCreator/src/org/tizen/installmanager/ui/page/PackageListPage.java
deleted file mode 100644 (file)
index d0c4e86..0000000
+++ /dev/null
@@ -1,591 +0,0 @@
-/*
- *  InstallManager
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: 
- * Wooyoung Cho <wooyoung1.cho@samsung.com>
- * Shihyun Kim <shihyun.kim@samsung.com>
- * Taeyoung Son <taeyoung2.son@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.ui.page;
-
-import java.text.DecimalFormat;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.jface.viewers.CheckStateChangedEvent;
-import org.eclipse.jface.viewers.CheckboxTreeViewer;
-import org.eclipse.jface.viewers.ColumnViewerToolTipSupport;
-import org.eclipse.jface.viewers.ICheckStateListener;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.MouseMoveListener;
-import org.eclipse.swt.events.MouseTrackAdapter;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.swt.widgets.TreeColumn;
-import org.eclipse.swt.widgets.TreeItem;
-import org.tizen.installmanager.core.Config;
-import org.tizen.installmanager.core.Options;
-import org.tizen.installmanager.lib.Platform;
-import org.tizen.installmanager.pkg.model.Package;
-import org.tizen.installmanager.pkg.model.PackageSet;
-import org.tizen.installmanager.ui.InstallManagerWindow;
-import org.tizen.installmanager.ui.model.Item;
-import org.tizen.installmanager.ui.model.ItemLabelProvider;
-import org.tizen.installmanager.ui.model.ItemTreeContentProvider;
-import org.tizen.installmanager.ui.model.Item.CheckState;
-import org.tizen.installmanager.ui.model.Item.InstallState;
-
-/**
- * Display install or uninstall package lists via tree view.
- * 
- * @author Taeyoung Son <taeyoung2.son@samsung.com>
- */
-public abstract class PackageListPage extends PageTemplate {
-
-       private Text mDescriptionText;
-       protected Tree tree;
-       private Label lblSelectPackage;
-       protected Label lblRequiredSize;
-       protected List<Item> items;
-       protected Label lblDescriptions;
-       CheckboxTreeViewer checkboxTreeViewer;
-       ViewController viewController = null;
-
-       Type mType = null;
-
-       private static final String EXTRAS_OF_TREE_ITEM = "EXTRAS";
-       public enum Type {
-               INSTALL, UNINSTALL, UPDATE
-       }
-       
-       /**
-        * Set environments for packagelist page, such as style, adding listener.
-        * 
-        * @param parent
-        * @param style
-        */
-       public PackageListPage(Composite parent, int style, final Type type) {
-               super(parent, style);
-
-               mType = type;
-
-               items = new ArrayList<Item>();
-               
-               setDescriptionText(customComposite);
-               
-               lblDescriptions = new Label(getCustomComposite(), SWT.NONE);
-               lblDescriptions.setBounds(0, 235, 124, 17);
-               if (Platform.isUbuntu()) {
-                       lblDescriptions.setFont((new Font(Display.getCurrent(), new FontData("Dejavu Sans", 11, SWT.BOLD))));
-               } else if (Platform.isWindows()) {
-                       lblDescriptions.setFont((new Font(Display.getCurrent(), new FontData("Verdana", 11, SWT.BOLD))));                       
-               }
-               lblDescriptions.setText("Description");
-               lblDescriptions.setBackground(InstallManagerWindow.getBackgroundColor());
-
-               checkboxTreeViewer = new CheckboxTreeViewer(customComposite, SWT.BORDER | SWT.H_SCROLL | SWT.LEFT);
-               tree = checkboxTreeViewer.getTree();
-               tree.setBounds(0, 0, 447, 230);
-               tree.setHeaderVisible(true);
-               tree.setLayoutData(new GridData(GridData.FILL_BOTH));
-               tree.addMouseTrackListener(new MouseTrackAdapter() {
-                       @Override
-                       public void mouseExit(MouseEvent arg0) {
-                               mDescriptionText.setText("Position your mouse pointer over an item to view its description.");
-                               mDescriptionText.setForeground(new Color(null, 96, 96, 96));
-                       }
-               });
-
-               tree.addMouseMoveListener(new MouseMoveListener() {
-                       @Override
-                       public void mouseMove(MouseEvent arg0) {
-                               Point mousePoint = new Point(arg0.x, arg0.y);
-                               TreeItem item = tree.getItem(mousePoint);
-                               if (item != null) {
-                                       mDescriptionText.setForeground(new Color(null, 0, 0, 0));
-                                       Item it = (Item)item.getData();
-                                       String packageName = it.getPackageName();
-                                       String description = viewController.getDescription(packageName);
-
-                                       if (!description.isEmpty())
-                                               mDescriptionText.setText(description);
-                                       else
-                                               mDescriptionText.setText("\"" + packageName + "\" category.");
-                               } else {
-                                       mDescriptionText.setText("Position your mouse pointer over an item to view its description.");
-                                       mDescriptionText.setForeground(new Color(null, 96, 96, 96));
-                               }
-                       }
-               });
-
-               TreeColumn trclmnA = new TreeColumn(tree, SWT.LEFT);
-               trclmnA.setWidth(260);
-               trclmnA.setText("Name");
-
-               TreeColumn trclmnB = new TreeColumn(tree, SWT.CENTER);
-               trclmnB.setWidth(110);
-               trclmnB.setText("Status");
-               
-               TreeColumn trclmnC = new TreeColumn(tree, SWT.CENTER);
-               trclmnC.setWidth(50);
-               trclmnC.setText("Size");
-
-               checkboxTreeViewer = new CheckboxTreeViewer(tree);
-
-               ColumnViewerToolTipSupport.enableFor(checkboxTreeViewer);
-
-               lblSelectPackage = new Label(getCustomComposite(), SWT.NONE);
-               lblSelectPackage.setBounds(0, 225, 402, 17);
-               lblSelectPackage.setText("");
-               lblSelectPackage.setBackground(InstallManagerWindow.getBackgroundColor());
-               lblSelectPackage.setVisible(false);
-
-               if (Config.status == Config.Status.INSTALL) {
-                       lblRequiredSize = new Label(getCustomComposite(), SWT.NONE);
-                       lblRequiredSize.setBounds(250, 235, 210, 23);
-                       lblRequiredSize.setBackground(InstallManagerWindow.getBackgroundColor());
-               }
-
-               checkboxTreeViewer.setContentProvider(new ItemTreeContentProvider());
-               checkboxTreeViewer.setLabelProvider(new ItemLabelProvider());
-
-               checkboxTreeViewer.setInput(getItems());
-
-               checkboxTreeViewer.addCheckStateListener(new ICheckStateListener() {
-                       @Override
-                       public void checkStateChanged(CheckStateChangedEvent e) {
-                               if (e.getElement() instanceof Item) {
-
-                                       Item item = (Item) e.getElement();
-                                       if (item.getPackageName().equals(Config.SDK_NAME)) {
-                                               checkboxTreeViewer.setSubtreeChecked(item, !e.getChecked());
-                                               setCheckbox(item, e.getChecked());
-                                               setNextBtnEnabledAboutCheckedPackageCount();
-                                               return;
-                                       } else {
-                                               setCheckbox(item, e.getChecked());
-                                               checkboxTreeViewer.refresh();
-
-                                               setNextBtnEnabledAboutCheckedPackageCount();
-                                               if (type == Type.INSTALL || type == Type.UPDATE) {
-                                                       lblRequiredSize.setText("Total space required : " 
-                                                                       + convertToVolumeSize(getCheckedPackageSize()));
-                                               }
-                                       }
-                               }
-                       }
-               });
-       }
-       
-       private void setDescriptionText(Composite composite) {
-               mDescriptionText = new Text(
-                               composite,
-                               SWT.BORDER | SWT.READ_ONLY | SWT.WRAP | SWT.H_SCROLL | SWT.CANCEL | SWT.MULTI);
-               mDescriptionText.setForeground(new Color(null, 96, 96, 96));
-               mDescriptionText.setText("Position your mouse pointer over an item to view its description.");
-               mDescriptionText.setEditable(false);
-               mDescriptionText.setEnabled(false);
-               
-               if (Platform.isUbuntu()) {
-                       mDescriptionText.setFont((new Font(Display.getCurrent(), new FontData("Dejavu Sans", 9, SWT.NONE))));
-               } else if (Platform.isWindows()) {
-                       mDescriptionText.setFont((new Font(Display.getCurrent(), new FontData("Verdana", 9, SWT.NONE))));                       
-               }
-               
-               if (mType == Type.INSTALL) {
-                       mDescriptionText.setBounds(0, 257, 447, 45);
-               } else if (mType == Type.UPDATE) {
-                       mDescriptionText.setBounds(0, 287, 447, 45);                    
-               }
-       }
-
-       protected void setNextBtnEnabledAboutCheckedPackageCount() {
-               if (getCheckedPackageNumber() > 0)
-                       InstallManagerWindow.setNextBtnEnabled(true);
-               else
-                       InstallManagerWindow.setNextBtnEnabled(false);
-       }
-
-       protected void setCheckbox(Item item, boolean checked) {
-               if (item == null) {
-                       return;
-               } else {
-                       setChildCheckbox(checkboxTreeViewer, item, checked);
-                       if (item.getParent() != null) {
-                               setParentCheckbox(item.getParent());
-                       }
-                       
-                       setCheckbox(items);
-               }
-       }
-
-       private void setChildCheckbox(CheckboxTreeViewer checkboxTreeViewer,
-                       Item selectedItem, boolean checked) {
-               if (!selectedItem.hasChildren()) {
-                       setCheckState(selectedItem, checked);
-               } else {
-                       for (Item item : selectedItem.getChildren()) {
-                               setChildCheckbox(checkboxTreeViewer, item, checked);
-                       }
-                       setCheckStateByChildren(selectedItem);
-               }
-       }
-
-       private void setCheckState(Item selectedItem, boolean checked) {
-               if (selectedItem.getInstallState() == InstallState.INSTALL) {
-                       selectedItem.setCheckState(checked);
-               }
-       }
-
-       private void setParentCheckbox(Item parentItem) {
-               if (parentItem == null) {
-                       return;
-               }
-               
-               setCheckStateByChildren(parentItem);
-               
-               if (parentItem.getParent() != null) {
-                       setParentCheckbox(parentItem.getParent());
-               }
-       }
-       
-       private void setCheckStateByChildren(Item treeItem) {
-               if (treeItem.isChildrenAllChecked()) {                  
-                       treeItem.setCheckState(true);
-               } else if (treeItem.isChildrenAllUnchecked()) {                 
-                       treeItem.setCheckState(false);
-               } else {                        
-                       treeItem.setCheckState(CheckState.GRAYED);
-               }
-       }
-       
-       protected void setCheckbox(List<Item> itemList) {
-               checkboxTreeViewer.setCheckedElements(itemList.toArray());
-               
-               for (Item item : itemList) {
-                       if (item.getCheckState() == CheckState.CHECKED) {
-                               checkboxTreeViewer.setGrayed(item, false);
-                               checkboxTreeViewer.setChecked(item, true);
-                       } else if (item.getCheckState() == CheckState.UNCHECKED) {
-                               checkboxTreeViewer.setGrayed(item, false);
-                               checkboxTreeViewer.setChecked(item, false);
-                       } else {
-                               checkboxTreeViewer.setGrayed(item, true);
-                       }
-               }
-       }
-
-       /**
-        * Get items list.
-        * 
-        * @return items list.
-        */
-       public List<Item> getItems() {
-               return items;
-       }
-
-       abstract public boolean loadPage(ViewController controller);
-
-       protected void loadPackagesToTreeViewer(PackageSet packageSet) {
-               //make tree items from package set.
-               List<Item> treeItems = makeTreeItem(packageSet);
-               
-               items.addAll(treeItems);
-               
-               // make relation for item tree.
-               makeRelation(items);
-               makeState();
-       }
-       
-       public void addExtensionPackagesToExtra(PackageSet packageSet) {
-               Item extraItem = getExtraTreeItem();
-               if (extraItem == null) {
-                       return;
-               }
-               
-               //Always refresh Extra component whatever add and remove.
-               removeChildrenOfExtra();
-               
-               setDisableExtra();
-               
-               List<Item> extensionItems = makeTreeItem(packageSet);
-               
-               makeRelation(extensionItems);
-               
-               //Add top items of extension items to extra.
-               for (Item extensionItem : extensionItems) {
-                       if (extensionItem.getParent() == null) {
-                               extraItem.addChildItem(extensionItem);
-                               extensionItem.setParent(extraItem);
-                       }
-               }
-               
-               for (Item item : items) {
-                       if (item.getPackageName().equals(EXTRAS_OF_TREE_ITEM)) {
-                               item.setStateByChildren();
-                       }
-               }
-
-               items.addAll(extensionItems);
-               checkboxTreeViewer.refresh();
-       }
-       
-       private List<Item> makeTreeItem(PackageSet packageSet) {
-               List<Item> treeItemList = new ArrayList<Item>();
-               
-               if (packageSet == null) {
-                       return treeItemList;
-               }
-
-               for (Package pkg : packageSet) {
-                       if (!pkg.isRootMeta() && !pkg.isPartnerMeta() && !pkg.isExtraMeta() && !pkg.isPublicMeta()) {
-                               continue;
-                       }
-
-                       if (!Options.partnerSdk) { // Public SDK case
-                               if (pkg.isPartnerMeta()) {
-                                       continue;
-                               }
-                       } else { // Partner SDK case
-                               if (pkg.isPublicMeta()) {
-                                       continue;
-                               }
-                       }
-                       
-                       String packageName = pkg.getPackageName();
-                       Package installedPackage = viewController.getInstalledPackage(packageName);
-
-                       InstallState itemState = getState(pkg);
-
-                       Item newItem = new Item(pkg, installedPackage, itemState);
-                       treeItemList.add(newItem);
-               }
-               
-               return treeItemList;
-       }
-       
-       private Item getExtraTreeItem() {
-               for (Item tItem : items) {
-                       if (tItem.getPackageName().equalsIgnoreCase(EXTRAS_OF_TREE_ITEM)) {
-                               return tItem;
-                       }
-               }
-               return null;
-       }
-       
-       private void setDisableExtra() {
-               checkboxTreeViewer.addCheckStateListener(new ICheckStateListener() {
-                       @Override
-                       public void checkStateChanged(CheckStateChangedEvent e) {
-                               Item item = (Item) e.getElement();
-                               if (item.equals(getExtraTreeItem())) {
-                                       if (!item.hasChildren()) {
-                                               checkboxTreeViewer.setChecked(item, false);
-                                               setNextBtnEnabledAboutCheckedPackageCount();
-                                       }
-                               }
-                       }
-               });
-       }
-
-       private void removeChildrenOfExtra() {
-               Item extraItem = getExtraTreeItem();
-               
-               for (Item childItem : extraItem.getChildren()) {
-                       removeTreeItem(childItem);
-               }
-               
-               extraItem.clearChildrenItems();
-       }
-       
-       private void removeTreeItem(Item item) {
-               if (item.hasChildren()) {
-                       for (Item childItem : item.getChildren()) {
-                               removeTreeItem(childItem);
-                       }
-               }
-               
-               items.remove(item);
-       }
-       private InstallState getState(Package pkg) {
-               if (viewController.getInstallableMetaPackageList().contains(pkg)) {
-                       return InstallState.INSTALL;
-               } else if (viewController.getUpdatableMetapackageList().contains(pkg)) {
-                       return InstallState.UPDATE;
-               } else {
-                       return InstallState.UNINSTALL;
-               }
-       }
-
-       private void makeRelation(List<Item> treeItems) {
-               // set relation of items.
-               for (Item item : treeItems) {
-                       setRelationOfItem(item, treeItems);
-               }
-
-               Collections.sort(treeItems);
-       }
-
-       private void makeState() {
-               for (Item item : items) {
-                       item.setStateByChildren();
-               }
-       }
-
-       private void setRelationOfItem(Item parentItem, List<Item> compareList) {
-               Package packageOfParentItem = parentItem.getPackage();
-               Collection<String> theChildPackage = packageOfParentItem.getDependentPackageNames();
-               
-               for (String childPackage : theChildPackage) {
-                       for (Item treeItem : compareList) {
-                               String packageNameOfTreeItem = treeItem.getPackageName();
-                               
-                               if (packageNameOfTreeItem.equalsIgnoreCase(childPackage)) {
-                                       parentItem.addChildItem(treeItem);
-                                       treeItem.setParent(parentItem);
-                                       break;
-                               }
-                       }
-               }
-       }
-
-       protected void setAllChecked(boolean checked) {
-               List<Item> items = getItems();
-               if (items == null) {
-                       return;
-               }
-               
-               for (Item treeItem : items) {
-                       setCheckbox(treeItem, checked);
-               }
-       }
-
-       protected void setDisableChecked(List<Item> items, boolean checked) {
-               if (items == null) {
-                       return;
-               }
-
-               for (Item item : items) {
-                       setDisableChecked(item, checked);
-               }
-       }
-
-       protected void setDisableChecked(Item item, boolean checked) {
-               if (item == null) {
-                       return;
-               }
-
-               setChildCheckbox(checkboxTreeViewer, item, checked);
-               setParentCheckbox(item);
-       }
-
-       /**
-        * Get checked packages count.
-        * 
-        * @return checked packages count.
-        */
-       public int getCheckedPackageNumber() {
-               int result = 0;
-               if (checkboxTreeViewer != null) {
-                       Object[] items = checkboxTreeViewer.getCheckedElements();
-                       result = items.length;
-               }
-               return result;
-       }
-
-       /**
-        * Get checked packages size.
-        * 
-        * @return checked packages size.
-        */
-       public long getCheckedPackageSize() {
-               List<String> listPkgName = new ArrayList<String>();
-
-               if (checkboxTreeViewer != null) {
-                       Object[] items = checkboxTreeViewer.getCheckedElements();
-
-                       for (Object item : items) {
-                               Item checkedItem = (Item)item;
-                               if (checkedItem.getCheckState() == CheckState.CHECKED) {
-                                       listPkgName.add(checkedItem.getPackageName());
-                               }
-                       }
-               }
-
-               return viewController.getTotalSizeWithDepends(listPkgName);
-       }
-
-       public List<String> getCheckedPackageNames() {
-               List<String> listPkgName = new ArrayList<String>();
-
-               if (checkboxTreeViewer != null) {
-                       Object[] items = checkboxTreeViewer.getCheckedElements();
-
-                       for (int i = 0; i < items.length; i++) {
-                               Item item = (Item) items[i];
-                               if (item.getParent() != null) {
-                                       listPkgName.add(item.getPackageName());
-                               }
-                       }
-               }
-
-               return listPkgName;
-       }
-
-       /**
-        * Calculate byte to GB, MB, KB.
-        * 
-        * @param byteSize
-        * @return Converted byte to GB, MB, KB
-        */
-       public String convertToVolumeSize(long byteSize) {
-               final double KB_SIZE = 1024;
-               final double MB_SIZE = KB_SIZE * 1024;
-               final double GB_SIZE = MB_SIZE * 1024;
-
-               String sizeStr;
-               String pattern = ".#";
-               DecimalFormat dformat = new DecimalFormat(pattern);
-
-               if (byteSize >= GB_SIZE)
-                       sizeStr = dformat.format((byteSize / GB_SIZE)) + "GB";
-               else if (byteSize >= MB_SIZE)
-                       sizeStr = dformat.format((byteSize / MB_SIZE)) + "MB";
-               else if (byteSize >= KB_SIZE)
-                       sizeStr = dformat.format((byteSize / KB_SIZE)) + "KB";
-               else
-                       sizeStr = byteSize + "byte";
-               return sizeStr;
-       }
-}
diff --git a/SdkImageCreator/src/org/tizen/installmanager/ui/page/SetInstallDirectoryPage.java b/SdkImageCreator/src/org/tizen/installmanager/ui/page/SetInstallDirectoryPage.java
deleted file mode 100644 (file)
index 3141c4a..0000000
+++ /dev/null
@@ -1,404 +0,0 @@
-/*
-*  InstallManager
-*
-* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
-*
-* Contact: 
-* Wooyoung Cho <wooyoung1.cho@samsung.com>
-* Shihyun Kim <shihyun.kim@samsung.com>
-* Taeyoung Son <taeyoung2.son@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.ui.page;
-
-import java.io.File;
-import java.text.DecimalFormat;
-import java.util.List;
-import java.util.regex.PatternSyntaxException;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.DirectoryDialog;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.tizen.installmanager.core.Config;
-import org.tizen.installmanager.core.IMFatalException;
-import org.tizen.installmanager.lib.IFileSystemInformation;
-import org.tizen.installmanager.lib.Platform;
-import org.tizen.installmanager.lib.ErrorController.ErrorCode;
-import org.tizen.installmanager.lib.linux.LinuxFileSystemInfo;
-import org.tizen.installmanager.lib.win.WindowsFileSystemInfo;
-import org.tizen.installmanager.ui.InstallManagerWindow;
-import org.tizen.installmanager.ui.dialog.MessageBoxDlg;
-import org.tizen.installmanager.ui.dialog.MessageBoxDlg.DialogType;
-import org.tizen.installmanager.util.PathUtil;
-
-
-
-/**
- * @author Taeyoung Son <taeyoung2.son@samsung.com>
- *
- */
-public class SetInstallDirectoryPage extends PageTemplate {
-
-       private static final String RSC_PATH_IMAGE = RESOURCE_PATH + "/install_manager_graphicmotif_002.png";
-       private static final String STRING_TITLE = "Location";
-       private static final String STRING_SUBTITLE = "Select the installation location.";
-       private static final String WINDOWS_DEFAULT_TARGET_PATH = "C:\\tizen-sdk";
-
-       private Text installDirectoryText;
-       private Label installDirectoryLabel;
-       private Label installDirectoryErrLabel;
-       private Label spaceRequiredLabel;
-       private Label spaceAvailableLabel;
-       private Button selectPathBtn;
-       ViewController viewController = null;
-       private long requiredSpace = 0;
-       private File selectedDisk = null;
-
-       /**
-        * @param parent
-        * @param style
-        */
-       public SetInstallDirectoryPage(Composite parent, int style) {
-               super(parent, style);
-               initPage();
-       }
-
-       /**
-        * Set default install target directory depends on platform.
-        */
-       private void setTargetDirectory() {
-               if (Platform.CURRENT_PLATFORM == Platform.LINUX_32
-                               || Platform.CURRENT_PLATFORM == Platform.LINUX_64
-                               || Platform.CURRENT_PLATFORM == Platform.MACOS_64) {
-                       installDirectoryText.setText(System.getProperty("user.home") + File.separator + Config.SDK_DIRECTORY);
-               } else if (Platform.CURRENT_PLATFORM == Platform.WINDOWS_32
-                               || Platform.CURRENT_PLATFORM == Platform.WINDOWS_64) {
-                       installDirectoryText.setText(WINDOWS_DEFAULT_TARGET_PATH);
-               } else {
-                       throw new IMFatalException(ErrorCode.UNSUPPORTED_PLATFORM);
-               }
-       }
-
-       /**
-        * Set basic environment of complete page. and check available space to install.
-        */
-       public void initPage() {
-               setLeftImageFromResource(RSC_PATH_IMAGE);
-               setTitle(STRING_TITLE);
-               setSubTitle(STRING_SUBTITLE);
-
-               installDirectoryLabel = new Label(customComposite, SWT.NONE);
-               installDirectoryLabel.setBounds(20, 80, 150, 17);
-               installDirectoryLabel.setText("Install " + Config.SDK_NAME + " to :");
-               installDirectoryLabel.setBackground(InstallManagerWindow.getBackgroundColor());
-
-               installDirectoryErrLabel = new Label(customComposite, SWT.WRAP);
-               installDirectoryErrLabel.setBounds(20, 140, 400, 50);
-               installDirectoryErrLabel.setBackground(InstallManagerWindow.getBackgroundColor());
-               installDirectoryErrLabel.setForeground(new Color(null, 255, 0, 0));
-
-               spaceRequiredLabel = new Label(customComposite, SWT.NONE);
-               spaceRequiredLabel.setBounds(20, 240, 250, 17);
-               spaceRequiredLabel.setBackground(InstallManagerWindow.getBackgroundColor());
-
-               spaceAvailableLabel = new Label(customComposite, SWT.NONE);
-               spaceAvailableLabel.setBounds(20, 265, 250, 17);
-               spaceAvailableLabel.setBackground(InstallManagerWindow.getBackgroundColor());
-
-               installDirectoryText = new Text(customComposite, SWT.BORDER);
-               installDirectoryText.setBounds(10, 105, 390, 27);
-               installDirectoryText.addModifyListener(new ModifyListener() {
-
-                       @Override
-                       public void modifyText(ModifyEvent arg0) {
-                               boolean availablePath = checkAvailablePath();
-                               InstallManagerWindow.setNextBtnEnabled(availablePath);
-                       }
-               });
-
-               setTargetDirectory();
-
-               selectPathBtn = new Button(customComposite, SWT.NONE);
-               selectPathBtn.addSelectionListener(new SelectionAdapter() {
-                       @Override
-                       public void widgetSelected(SelectionEvent e) {
-                               boolean isAvailablePath = true;
-                               do {
-                                       String strDir = showSettingInstallpathDlg();
-                                       if (strDir != null) {
-                                               if (requiredSpace > getAvailableSpaceSize(strDir)) {
-                                                       isAvailablePath = false;
-                                                       MessageBoxDlg.showDlg(
-                                                                       e.display.getShells()[0],
-                                                                       "Error",
-                                                                       "Not enough disk space for the installation. Select a different installation path.",
-                                                                       DialogType.ERROR, false);
-                                               } else
-                                                       isAvailablePath = true;
-
-                                               if (isAvailablePath == true) {
-                                                       File strFile = new File(strDir + File.separator + Config.SDK_DIRECTORY);
-                                                       installDirectoryText.setText(strFile.getAbsolutePath());
-                                                       setAvailableSpace(strDir);
-                                                       spaceAvailableLabel.setText("Space available : " + convertToVolumeSize(selectedDisk.getUsableSpace()));
-                                               }
-                                       } else
-                                               isAvailablePath = true;
-                               } while (isAvailablePath == false);
-                       }
-               });
-               selectPathBtn.setImage(PathUtil.getImageFromResource("/res/icons/icon_directory_open.png"));
-               selectPathBtn.setBounds(408, 105, 35, 29);
-       }
-
-       private boolean checkAvailablePath() {
-               if (installDirectoryText.getText().equals("")) {
-                       installDirectoryErrLabel.setText("Set the installation path.");
-                       spaceAvailableLabel.setText("Space available : ");
-                       return false;
-               }
-
-               try {
-                       if (Platform.CURRENT_PLATFORM == Platform.LINUX_32
-                                       || Platform.CURRENT_PLATFORM == Platform.LINUX_64) {
-                               if (!installDirectoryText.getText().matches("[^= ]+")) {
-                                       installDirectoryErrLabel.setText("Value cannot contain the '=' character or spaces.");
-                                       return false;
-                               } else {
-                                       if (!installDirectoryText.getText().startsWith(System.getProperty("user.home"))) {
-                                               installDirectoryErrLabel.setText("Set the installation path to the home directory.");
-                                               return false;
-                                       }
-                               }
-                       } else if (Platform.CURRENT_PLATFORM == Platform.WINDOWS_32
-                                       || Platform.CURRENT_PLATFORM == Platform.WINDOWS_64) {
-                               if (!installDirectoryText.getText().matches("[^`~!@#$%^&*=? ]+")) {
-                                       installDirectoryErrLabel.setText("Value cannot contain special characters or spaces.");
-                                       return false;
-                               }
-                       }
-               } catch (PatternSyntaxException e) {
-               }
-
-               long availableSize = getAvailableSpaceSize(installDirectoryText.getText());
-               if (availableSize >= 0)
-                       spaceAvailableLabel.setText("Space available : " + convertToVolumeSize(availableSize));
-               else {
-                       installDirectoryErrLabel.setText("Set the installation path correctly.");
-                       spaceAvailableLabel.setText("Space available : ");
-                       return false;
-               }
-               if (requiredSpace > availableSize) {
-                       installDirectoryErrLabel.setText("Not enough disk space for the installation. Select a different installation path.");
-                       return false;
-               }
-               installDirectoryErrLabel.setText("");
-               return true;
-       }
-
-       /**
-        * Display install directory page, if space is not available for install, page will show warning dialog.
-        * @param controller
-        * @param requiredSize
-        * @return
-        */
-       public boolean loadPage(ViewController controller, long requiredSize) {
-               boolean result = true;
-               viewController = controller;
-               requiredSpace = requiredSize;
-
-               InstallManagerWindow.setNextBtnEnabled(checkAvailablePath());
-               setAvailableSpace(installDirectoryText.getText());
-
-               spaceRequiredLabel.setText("Total space required : " + convertToVolumeSize(requiredSize));
-               if (selectedDisk != null)
-                       spaceAvailableLabel.setText("Space available : " + convertToVolumeSize(selectedDisk.getUsableSpace()));
-               else {
-                       MessageBoxDlg.showDlg(
-                                       Display.getCurrent().getShells()[0], "Notify",
-                                       "Select the installation path.", DialogType.ERROR, false);
-               }
-               return result;
-       }
-
-       /**
-        * Get install path.
-        * @return install path.
-        */
-       public String getInstallPath() {
-               String temp = installDirectoryText.getText();
-               String installPath = installDirectoryText.getText();
-               if (temp.startsWith("~")) {
-                       installPath = temp.replaceFirst("~", System.getProperty("user.home"));
-               }
-               return installPath;
-       }
-
-       /**
-        * Calculating byte to GB, MB, KB
-        * @param byteSize
-        * @return converted byte size.
-        */
-       public String convertToVolumeSize(long byteSize) {
-               final double KB_SIZE = 1024;
-               final double MB_SIZE = KB_SIZE * 1024;
-               final double GB_SIZE = MB_SIZE * 1024;
-
-               String sizeStr;
-               String pattern = ".#";
-               DecimalFormat dformat = new DecimalFormat(pattern);
-
-               if (byteSize >= GB_SIZE)
-                       sizeStr = dformat.format((byteSize / GB_SIZE)) + "GB";
-               else if (byteSize >= MB_SIZE)
-                       sizeStr = dformat.format((byteSize / MB_SIZE)) + "MB";
-               else if (byteSize >= KB_SIZE)
-                       sizeStr = dformat.format((byteSize / KB_SIZE)) + "KB";
-               else
-                       sizeStr = byteSize + "byte";
-               return sizeStr;
-       }
-
-       private void setAvailableSpace(String selectedPath) {
-               IFileSystemInformation fsInfo;
-               if (Platform.CURRENT_PLATFORM == Platform.LINUX_32
-                               || Platform.CURRENT_PLATFORM == Platform.LINUX_64
-                               || Platform.CURRENT_PLATFORM == Platform.MACOS_64)
-                       fsInfo = new LinuxFileSystemInfo();
-               else if (Platform.CURRENT_PLATFORM == Platform.WINDOWS_32
-                               || Platform.CURRENT_PLATFORM == Platform.WINDOWS_64)
-                       fsInfo = new WindowsFileSystemInfo();
-               else
-                       fsInfo = new IFileSystemInformation() {
-
-                               @Override
-                               public List<File> getListMounts() {
-                                       // TODO Auto-generated method stub
-                                       return null;
-                               }
-
-                               @Override
-                               public File[] getListDevices() {
-                                       // TODO Auto-generated method stub
-                                       return null;
-                               }
-
-                               @Override
-                               public FileSystemType getFileSystemType(File disk) {
-                                       // TODO Auto-generated method stub
-                                       return FileSystemType.UNKNOWN;
-                               }
-                       };
-
-               List<File> mountList = fsInfo.getListMounts();
-               if (mountList == null)
-                       return;
-               String selectedRoot = "";
-               for (int i = 0; i < mountList.size(); i++) {
-                       if (selectedPath.toLowerCase().startsWith(
-                                       mountList.get(i).getAbsolutePath().toLowerCase())) {
-                               if (!selectedRoot.startsWith(mountList.get(i).getAbsolutePath())) {
-                                       selectedRoot = mountList.get(i).getAbsolutePath();
-                                       selectedDisk = mountList.get(i);
-                               }
-                       }
-               }
-       }
-
-       private long getAvailableSpaceSize(String selectedPath) {
-               IFileSystemInformation fsInfo;
-               if (Platform.CURRENT_PLATFORM == Platform.LINUX_32
-                               || Platform.CURRENT_PLATFORM == Platform.LINUX_64
-                               || Platform.CURRENT_PLATFORM == Platform.MACOS_64)
-                       fsInfo = new LinuxFileSystemInfo();
-               else if (Platform.CURRENT_PLATFORM == Platform.WINDOWS_32
-                               || Platform.CURRENT_PLATFORM == Platform.WINDOWS_64)
-                       fsInfo = new WindowsFileSystemInfo();
-               else
-                       fsInfo = new IFileSystemInformation() {
-
-                               @Override
-                               public List<File> getListMounts() {
-                                       // TODO Auto-generated method stub
-                                       return null;
-                               }
-
-                               @Override
-                               public File[] getListDevices() {
-                                       // TODO Auto-generated method stub
-                                       return null;
-                               }
-
-                               @Override
-                               public FileSystemType getFileSystemType(File disk) {
-                                       // TODO Auto-generated method stub
-                                       return FileSystemType.UNKNOWN;
-                               }
-                       };
-
-               List<File> mountList = fsInfo.getListMounts();
-               if (mountList == null)
-                       return 0;
-               String selectedRoot = "";
-               long freeSpaceSize = -1;
-               for (int i = 0; i < mountList.size(); i++) {
-                       if (selectedPath.toLowerCase().startsWith(
-                                       mountList.get(i).getAbsolutePath().toLowerCase())) {
-                               if (!selectedRoot.startsWith(mountList.get(i).getAbsolutePath())) {
-                                       selectedRoot = mountList.get(i).getAbsolutePath();
-                                       freeSpaceSize = mountList.get(i).getUsableSpace();
-                               }
-                       }
-               }
-               return freeSpaceSize;
-       }
-
-       private String showSettingInstallpathDlg() {
-               DirectoryDialog dlg = new DirectoryDialog(Display.getCurrent().getShells()[0]);
-               dlg.setFilterPath(getInstallPath());
-               dlg.setText("Install Manager Directory");
-               dlg.setMessage("Select a directory");
-
-               String strDir = dlg.open();
-
-               return strDir;
-       }
-
-       /**
-        * Check install path validation for space.
-        * @return
-        * true : available<br>
-        * false : unavailable
-        */
-       public boolean isInstallablePath() {
-               if (requiredSpace > getAvailableSpaceSize(installDirectoryText.getText()))
-                       return false;
-               return true;
-       }
-}
diff --git a/SdkImageCreator/src/org/tizen/installmanager/ui/page/UninstallableListPage.java b/SdkImageCreator/src/org/tizen/installmanager/ui/page/UninstallableListPage.java
deleted file mode 100644 (file)
index 2a9dfeb..0000000
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
-*  InstallManager
-*
-* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
-*
-* Contact: 
-* Wooyoung Cho <wooyoung1.cho@samsung.com>
-* Shihyun Kim <shihyun.kim@samsung.com>
-* Taeyoung Son <taeyoung2.son@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.ui.page;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.viewers.CheckStateChangedEvent;
-import org.eclipse.jface.viewers.ICheckStateListener;
-import org.eclipse.swt.widgets.Composite;
-import org.tizen.installmanager.ui.model.Item;
-
-
-/**
- * This class displays uninstallable package list on page.
- * @author Taeyoung Son <taeyoung2.son@samsung.com>
- */
-public class UninstallableListPage extends PackageListPage {
-       static final String RSC_PATH_IMAGE = RESOURCE_PATH + "/uninstaller_graphicmotif_001.png";
-       static final String STRING_TITLE = "Uninstall Items";
-       static final String STRING_SUBTITLE = "You can see the items to uninstall.";
-
-       /**
-        * Display packages tree structure and add check state listener. a package is selected by check,
-        * if selected package has child packages, tree will be expanded and show children of selected package.  
-        * @param parent
-        * @param style
-        */
-       public UninstallableListPage(Composite parent, int style) {
-               super(parent, style, Type.UNINSTALL);
-
-               setLeftImageFromResource(RSC_PATH_IMAGE);
-               setTitle(STRING_TITLE);
-               setSubTitle(STRING_SUBTITLE);
-
-               checkboxTreeViewer.addCheckStateListener(new ICheckStateListener() {
-                       @Override
-                       public void checkStateChanged(CheckStateChangedEvent e) {
-                               if (e.getChecked()) {
-                                       checkboxTreeViewer.setSubtreeChecked(e.getElement(), true);
-                                       if (e.getElement() instanceof Item) {
-                                               Item item = (Item) e.getElement();
-                                               item.setSubItemChecked(true);
-                                               Object[] descendants = item.getDescendants().toArray();
-                                               for (int i = 0; i < descendants.length; i++)
-                                                       checkboxTreeViewer.setGrayed(descendants[i], false);
-                                       }
-                               } else {
-                                       checkboxTreeViewer.setSubtreeChecked(e.getElement(), false);
-                                       if (e.getElement() instanceof Item) {
-                                               Item item = (Item) e.getElement();
-                                               item.setSubItemChecked(false);
-                                               Object[] descendants = item.getDescendants().toArray();
-                                               for (int i = 0; i < descendants.length; i++)
-                                                       checkboxTreeViewer.setGrayed(descendants[i], false);
-                                       }
-                               }
-                               if (e.getElement() instanceof Item) {
-                                       List<Item> grayCheckedItems = new ArrayList<Item>();
-                                       List<Item> checkedItems = new ArrayList<Item>();
-                                       List<Item> unCheckedItems = new ArrayList<Item>();
-                                       Item item = (Item) e.getElement();
-                                       if (item.getParent() != null) {
-                                               item.getParent().checkSuperItemGrayed(
-                                                               grayCheckedItems, checkedItems, unCheckedItems);
-                                               for (int i = 0; i < grayCheckedItems.size(); i++) {
-                                                       checkboxTreeViewer.setGrayChecked(grayCheckedItems.get(i), true);
-                                               }
-                                               for (int i = 0; i < checkedItems.size(); i++) {
-                                                       checkboxTreeViewer.setGrayed(checkedItems.get(i), false);
-                                                       checkboxTreeViewer.setChecked(checkedItems.get(i), true);
-                                               }
-                                               for (int i = 0; i < unCheckedItems.size(); i++) {
-                                                       checkboxTreeViewer.setGrayed(unCheckedItems.get(i), false);
-                                                       checkboxTreeViewer.setChecked(unCheckedItems.get(i), false);
-                                               }
-                                       }
-                               }
-                       }
-               });
-       }
-
-       /**
-        * Display uninstallable list page.
-        */
-       public boolean loadPage(ViewController controller) {
-               this.viewController = controller;
-               getItems().clear();
-
-               loadPackagesToTreeViewer(viewController.getRemovableMetaPackageList());
-
-               if (getItems().size() <= 0) {
-                       setUninstallAll();
-               }
-
-               setUninstallColumn();
-               checkboxTreeViewer.refresh();
-               setAllChecked(true);
-               return true;
-       }
-
-       /**
-        * Change column in uninstallable list page.
-        */
-       protected void setUninstallColumn() {
-               tree.getColumn(1).setText("Status");
-//             tree.getColumn(1).setWidth(0);
-//             tree.getColumn(2).setText("Installed version");
-//             tree.getColumn(3).setWidth(0);
-       }
-
-       /**
-        * When all packages must be removed, Set TIZEN SDK item in uninstallable list page 
-        */
-       protected void setUninstallAll() {
-               //TODO impl
-//             getItems().add(new Item(null, Config.SDK_NAME, "", "unknown", 0, State.UNINSTALL));
-       }
-}
diff --git a/SdkImageCreator/src/org/tizen/installmanager/ui/page/UninstallingPage.java b/SdkImageCreator/src/org/tizen/installmanager/ui/page/UninstallingPage.java
deleted file mode 100644 (file)
index 3fa42c8..0000000
+++ /dev/null
@@ -1,344 +0,0 @@
-/*
-*  InstallManager
-*
-* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
-*
-* Contact: 
-* Wooyoung Cho <wooyoung1.cho@samsung.com>
-* Shihyun Kim <shihyun.kim@samsung.com>
-* Taeyoung Son <taeyoung2.son@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.ui.page;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.ProgressBar;
-import org.tizen.installmanager.core.IMFatalException;
-import org.tizen.installmanager.core.InstallManager;
-import org.tizen.installmanager.lib.ErrorController;
-import org.tizen.installmanager.lib.IIMProgressMonitor;
-import org.tizen.installmanager.lib.Log;
-import org.tizen.installmanager.lib.ProgramController;
-import org.tizen.installmanager.pkg.model.PackageSet;
-import org.tizen.installmanager.ui.InstallManagerWindow;
-import org.tizen.installmanager.ui.dialog.MessageBoxDlg;
-import org.tizen.installmanager.ui.dialog.MessageBoxDlg.DialogType;
-import org.tizen.installmanager.pkg.model.Package;
-
-/**
- * @author Taeyoung Son <taeyoung2.son@samsung.com>
- * @author Shihyun Kim <shihyun.kim@samsung.com>
- */
-public class UninstallingPage extends PageTemplate {
-       static final String RSC_PATH_IMAGE = RESOURCE_PATH + "/uninstaller_graphicmotif_002.png";
-       static final String STRING_TITLE = "Uninstalling...";
-       static final String STRING_SUBTITLE = "";
-
-
-       private ProgressBar progressBar;
-       private Label statusLabel;
-       private Label uninstalledNumberLabel;
-       private Label mSubTitleOfProgress;
-
-       private ViewController viewController;
-       private UninstallProgressMonitor monitor;
-       private InstallManagerWindow mainWindow;
-       Display display;
-
-       /**
-        * Set basic environment of uninstalling page.
-        * @param parent
-        * @param style
-        */
-       public UninstallingPage(Composite parent, int style) {
-               super(parent, style);
-               setLeftImageFromResource(RSC_PATH_IMAGE);
-               setTitle(STRING_TITLE);
-               setSubTitle(STRING_SUBTITLE);
-
-               progressBar = new ProgressBar(customComposite, SWT.NONE);
-               progressBar.setBounds(40, 110, 396, 20);
-
-               statusLabel = new Label(customComposite, SWT.NONE);
-               statusLabel.setBounds(40, 80, 343, 23);
-               statusLabel.setForeground(new Color(null, 96, 96, 96));
-               statusLabel.setBackground(InstallManagerWindow.getBackgroundColor());
-
-               mSubTitleOfProgress = new Label(customComposite, SWT.NONE);
-               mSubTitleOfProgress.setBounds(40, 138, 250, 23);
-               mSubTitleOfProgress.setBackground(InstallManagerWindow.getBackgroundColor());
-               mSubTitleOfProgress.setText("");
-
-               uninstalledNumberLabel = new Label(customComposite, SWT.CENTER);
-               uninstalledNumberLabel.setBounds(353, 138, 80, 23);
-               uninstalledNumberLabel.setBackground(InstallManagerWindow.getBackgroundColor());
-               uninstalledNumberLabel.setText("");
-       }
-
-       /**
-        * Display uninstalling page, if sdk is running during uninstalling, page will show warning dialog.
-        * @param selectedList
-        * @param vController
-        * @param mainWindow
-        * @return
-        */
-       public boolean loadPage(
-                       List<String> selectedList, ViewController vController,
-                       InstallManagerWindow mainWindow) {
-               this.viewController = vController;
-               this.mainWindow = mainWindow;
-               monitor = new UninstallProgressMonitor();
-               display = customComposite.getDisplay();
-
-               //kill running process.
-               ProgramController controller = ProgramController.createProgramController();
-               if (controller.runningProgramExists()) {
-                       int confirm = MessageBoxDlg.showDlg(
-                                       getShell(),
-                                       "Warning",
-                                       "SDK is running now. If you update the SDK, the running is stopped. Are you sure to uninstall the SDK?",
-                                       DialogType.WARNING, false);
-                       if (confirm == MessageBoxDlg.YES) {
-                               controller.terminateRunningProgram();
-                       } else if (confirm == MessageBoxDlg.NO) {
-                               return false;
-                       }
-               } else {}
-               
-               //start uninstall.
-               final UninstallThread uninstallThread = new UninstallThread(monitor);
-               uninstallThread.start();                
-               
-               return true;
-       }
-
-       /**
-        * This class controls process to uninstall.
-        * @author Shihyun Kim <Shihyun.kim@samsung.com>
-        */
-       class UninstallThread extends Thread {
-               private IIMProgressMonitor monitor;
-
-               public UninstallThread(IIMProgressMonitor monitor) {
-                       this.monitor = monitor;
-               }
-
-               /**
-                * Uninstalling thread run
-                */
-               @Override
-               public void run() {
-                       try {
-                               uninstallProcess(monitor);
-                       } catch (IMFatalException e) {
-                               Log.err("internal error occurred");
-                               Log.ExceptionLog(e);
-                               ErrorController.setInstallationSuccess(false);
-                       } catch (Exception e) {
-                               Log.err("Unexpected exception occurred");
-                               Log.ExceptionLog(e);
-                               ErrorController.setInstallationSuccess(false);
-                       } finally {
-                               monitor.done();
-                       }
-                       Log.log("finish uninstall thread");
-               }
-       }
-
-       /**
-        * After check selected package list size, start to uninstall.
-        * @param monitor
-        */
-       public void uninstallProcess(IIMProgressMonitor monitor) {
-               boolean result = false;
-
-               PackageSet pkgs = InstallManager.getInstance().getPackageManager().getInstalledPackages();
-               List<String> installedList = new ArrayList<String>();
-               for (Package pkg : pkgs) {
-                       installedList.add(pkg.getPackageName());
-               }
-               
-               if (installedList.size() <= 0) {
-                       return;
-               } else {
-                       result = viewController.uninstall(installedList, monitor);
-               }
-
-               ErrorController.setInstallationSuccess(result);
-       }
-
-       /**
-        * @author Shihyun Kim <shihyun.kim@samsung.com>
-        */
-       public class UninstallProgressMonitor implements IIMProgressMonitor {
-
-               private int totalWork;
-               private String mProgressTitle = "";
-               private String mSubTitle = "";
-
-               private final int MAX_LENGTH = 40;
-               private final String STRING_ETC = "...";
-
-               @Override
-               public void beginTask(final String name, int totalWork) {
-                       this.mProgressTitle = name;
-                       this.totalWork = totalWork;
-                       display.asyncExec(new Runnable() {
-
-                               @Override
-                               public void run() {
-                                       statusLabel.setText(name);
-                               }
-                       });
-               }
-
-               /**
-                * Control to finish uninstall process
-                */
-               @Override
-               public void done() {
-                       display.asyncExec(new Runnable() {
-                               @Override
-                               public void run() {
-                                       progressBar.setSelection(100);
-
-                                       CompletePage completePage = mainWindow.getCompletePage();
-                                       completePage.setLeftImageFromResource(CompletePage.RSC_PATH_UNINSTALL_IMAGE);
-                                       completePage.showCheckButton(false);
-                                       mainWindow.setCancelBtnEnabled(true);
-                                       mainWindow.showComposite(completePage);
-
-                                       if (ErrorController.checkInstallationSuccess()) {
-                                               completePage.setTitle("Uninstallation Completed!");
-                                               if (!viewController.existRemovablePackage()) {
-                                                       completePage.removeTargetDir();
-                                               } else {};
-                                               
-                                               String msg = "Thank you for using Tizen SDK. ";
-       
-                                               completePage.setCustomMessage(msg);
-                                       } else {
-                                               completePage.setTitle("Uninstallation Failed!");
-                                               completePage.setCustomErrorMessage("Sorry, Uninstallation was not success. Please try uninstall again.");
-                                       }
-                               }
-                       });
-               }
-
-               @Override
-               public void internalWorked(double work) {
-                       // Do nothing.
-               }
-
-               @Override
-               public boolean isCanceled() {
-                       return false;
-               }
-
-               @Override
-               public void setCanceled(boolean value) {
-                       // Do nothing.
-               }
-
-               @Override
-               public void setTaskName(String name) {
-                       // Do nothing.
-               }
-
-               @Override
-               public void subTask(String name) {
-                       // Do nothing.
-               }
-
-               @Override
-               public void setPackageName(String name) {
-                       mProgressTitle = name;
-               }
-
-               @Override
-               public void setFileName(String name) {
-                       if (name.length() > MAX_LENGTH) {
-                               mSubTitle = name.substring(0, MAX_LENGTH - 2);
-                               mSubTitle = mSubTitle + STRING_ETC;
-                       } else {
-                               mSubTitle = name;
-                       }
-               }
-
-               /**
-                * set working package name to show during uninstalling
-                */
-               @Override
-               public void worked(final int work) {
-                       display.asyncExec(new Runnable() {
-                               @Override
-                               public void run() {
-                                       statusLabel.setText("Processing : package \"" + mProgressTitle + "\"");
-                                       mSubTitleOfProgress.setText(mSubTitle);
-                                       uninstalledNumberLabel.setText(work + "/" + totalWork);
-                                       progressBar.setSelection(100 * work / totalWork);
-                               }
-                       });
-               }
-
-               /**
-                * set working file name to show during uninstalling 
-                */
-               @Override
-               public void workedFileName() {
-                       display.asyncExec(new Runnable() {
-                               @Override
-                               public void run() {
-                                       mSubTitleOfProgress.setText(mSubTitle);
-                               }
-                       });
-               }
-
-               @Override
-               public void workedDownload(long size) {
-                       // TODO Auto-generated method stub
-
-               }
-
-               @Override
-               public void setDownloadStartTime(long startTime) {
-                       // TODO Auto-generated method stub
-
-               }
-
-               @Override
-               public void workedChecksum(long size) {
-                       // TODO Auto-generated method stub
-
-               }
-
-               @Override
-               public void workedProgressbar(int percent) {
-                       progressBar.setSelection(percent);
-               }
-       }
-}
diff --git a/SdkImageCreator/src/org/tizen/installmanager/ui/page/UpdatableListPage.java b/SdkImageCreator/src/org/tizen/installmanager/ui/page/UpdatableListPage.java
deleted file mode 100644 (file)
index 73e7609..0000000
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
-*  InstallManager
-*
-* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
-*
-* Contact: 
-* Wooyoung Cho <wooyoung1.cho@samsung.com>
-* Shihyun Kim <shihyun.kim@samsung.com>
-* Taeyoung Son <taeyoung2.son@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.ui.page;
-
-
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.widgets.Composite;
-import org.tizen.installmanager.core.IMFatalException;
-import org.tizen.installmanager.core.SDKExtensionInfo;
-import org.tizen.installmanager.lib.ErrorController;
-import org.tizen.installmanager.lib.IMError;
-import org.tizen.installmanager.lib.Log;
-
-/**
- * This class displays installable package list on page.
- * @author Yongsung Kim <yongsung1.kim@samsung.com>
- */
-public class UpdatableListPage extends PackageListPage {
-
-       static final String RSC_PATH_IMAGE = RESOURCE_PATH + "/install_manager_graphicmotif_002.png";
-       static final String STRING_TITLE = "Update";
-       static final String STRING_SUBTITLE = "Updated components are installed.\n" +
-                                                                               "You can select additional components for installation as well.";
-       
-       /**
-        * @param parent
-        * @param style
-        */
-       public UpdatableListPage(Composite parent, int style) {
-               super(parent, style, Type.UPDATE);
-               setLeftImageFromResource(RSC_PATH_IMAGE);
-               setTitleBounds(160, 3, 468, 20);
-               setSubTitleBounds(160, 25, 468, 30);
-               setCustomCompositeBounds(160, 60, 468, 334);
-               setTitle(STRING_TITLE);
-               setSubTitle(STRING_SUBTITLE);
-               setSubTitleFont(new FontData("Dejavu Sans", 9, SWT.NONE));
-               tree.setBounds(0, 0, 447, 260);
-               lblRequiredSize.setBounds(250, 265, 210, 23);
-               lblDescriptions.setBounds(0, 265, 124, 17);
-       }
-
-       /**
-        * Display installable package list from view controller.
-        */
-       public boolean loadPage(ViewController controller) {
-               this.viewController = controller;
-               getItems().clear();
-
-               try {
-                       loadPackagesToTreeViewer(viewController.getRootMetaPackageListOfRepository());
-                       
-                       SDKExtensionInfo sdkExtensionInfo = SDKExtensionInfo.getInstance();
-                       addExtensionPackagesToExtra(sdkExtensionInfo.getExtensionPackages());
-                       
-               } catch (IMFatalException fatalException) {
-                       Log.err(ErrorController.getErrorMessage());
-                       IMError.fatalError(ErrorController.getErrorMessage());
-               }
-
-               if (getItems().size() <= 0) {
-                       return false;
-               }
-               
-               setCheckbox(items);
-               
-               checkboxTreeViewer.refresh();
-
-               setNextBtnEnabledAboutCheckedPackageCount();
-               lblRequiredSize.setText("Total space required : " + convertToVolumeSize(getCheckedPackageSize()));
-
-               return true;
-       }
-}
diff --git a/SdkImageCreator/src/org/tizen/installmanager/ui/page/ViewController.java b/SdkImageCreator/src/org/tizen/installmanager/ui/page/ViewController.java
deleted file mode 100644 (file)
index 3cf7d47..0000000
+++ /dev/null
@@ -1,439 +0,0 @@
-/*
-*  InstallManager
-*
-* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
-*
-* Contact: 
-* Wooyoung Cho <wooyoung1.cho@samsung.com>
-* Shihyun Kim <shihyun.kim@samsung.com>
-* Taeyoung Son <taeyoung2.son@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.ui.page;
-
-import java.io.File;
-import java.util.Collection;
-import java.util.List;
-
-import org.tizen.installmanager.core.Config;
-import org.tizen.installmanager.core.IMExitException;
-import org.tizen.installmanager.core.IMFatalException;
-import org.tizen.installmanager.core.InstallManager;
-import org.tizen.installmanager.core.Options;
-import org.tizen.installmanager.core.Config.ServerType;
-import org.tizen.installmanager.lib.ErrorController;
-import org.tizen.installmanager.lib.IIMProgressMonitor;
-import org.tizen.installmanager.lib.Log;
-import org.tizen.installmanager.lib.Registry;
-import org.tizen.installmanager.lib.ErrorController.ErrorCode;
-import org.tizen.installmanager.pkg.lib.PackageManager;
-import org.tizen.installmanager.pkg.model.Package;
-import org.tizen.installmanager.pkg.model.PackageSet;
-import org.tizen.installmanager.ui.page.InstallingPage.InstallProgressMonitor;
-import org.tizen.installmanager.util.PathUtil;
-
-
-/**
- * This class is a connector between Model and View. Model and View can communicate each other via ViewController. 
- * @author Taeyoung Son <taeyoung2.son@samsung.com>
- */
-public class ViewController {
-
-       private InstallManager installManager;
-       private PackageManager packageManager;
-
-       /**
-        * Initialize objects which need to install.
-        * @return
-        * true : Success to Initialize<br>
-        * false : Fail to Initialize
-        */
-       public boolean init() {
-               Log.log("ViewController init");
-               
-               try {
-                       installManager = InstallManager.getInstance();
-                       installManager.init();
-                       packageManager = installManager.getPackageManager();
-                       
-                       if (packageManager == null) {
-                               throw new IMFatalException("Cannot read package information.");
-                       } else {
-                               if (existInstallableOrRemovablePackages()) {
-                                       return true;
-                               } else {
-                                       ErrorController.setInstallationSuccess(false);
-                                       return false;
-                               }
-                       }
-               } catch(IMFatalException e) {
-                       Log.ExceptionLog(e);
-                       return false;
-               }
-       }
-
-       /**
-        * Get meta packages that are available to install or to update.
-        * @return Meta package set
-        */
-       public PackageSet getInstallableOrUpdatableMetaPackages() {
-               if (packageManager == null) {
-                       return null;
-               } else {
-                       return packageManager.getInstallableOrUpdatableMetaPackages();
-               }
-       }
-
-       /**
-        * Get meta packages that are available to install.
-        * @return Meta package set
-        */
-       public PackageSet getInstallableMetaPackageList() {
-               if (packageManager == null) {
-                       return null;
-               } else {
-                       return packageManager.getInstallableMetaPackages();
-               }
-       }
-       
-       /**
-        * Get meta packages in repository.
-        * @return Meta package set
-        */
-       public PackageSet getRootMetaPackageListOfRepository() {
-               if (packageManager == null) {
-                       return null;
-               } else {
-                       return packageManager.getRootMetaPackagesOfRepository();
-               }
-       }
-
-       /**
-        * Get meta packages that are available to update.
-        * @return Meta package set
-        */
-       public PackageSet getUpdatableMetapackageList() {
-               if (packageManager == null) {
-                       return null;
-               } else {
-                       return packageManager.getUpdatableMetaPackages();
-               }
-       }
-       
-       /**
-        * Get meta packages that are available to update.
-        * @return Meta package set
-        */
-       public PackageSet getNotUpdatableMetapackageList() {
-               if (packageManager == null) {
-                       return null;
-               } else {
-                       return packageManager.getNotInstallableAndNotUpdatablePackages();
-               }
-       }
-
-       /**
-        * Get meta packages that are available to remove.
-        * @return Meta package set
-        */
-       public PackageSet getRemovableMetaPackageList() {
-               if (packageManager == null) {
-                       return null;
-               } else {
-                       return packageManager.getRemovableMetaPackages();
-               }
-       }
-       
-       public PackageSet getInstallablePackageListInSnapshot() {
-               if (packageManager == null) {
-                       return null;
-               } else {
-                       return packageManager.getInstallableMetaPackagesInSnapshot();
-               }
-       }
-
-       /**
-        * Get packages that are available to remove.
-        * @return package set
-        */
-       public PackageSet getRemovablePackageList() {
-               if (packageManager == null) {
-                       return null;
-               } else {
-                       return packageManager.getInstalledPackages();
-               }
-       }
-
-       /**
-        * Check to exist removable packages.
-        * @return if installed package exists, return true. if not return false.
-        */
-       public boolean existRemovablePackage() {
-               if (packageManager == null) {
-                       return false;
-               } else {
-                       return packageManager.existInstalledPackages();
-               }
-       }
-
-       /**
-        * Start to install and update.
-        * @param installList : selected mata packages
-        * @param targetPath : install path
-        * @param monitor
-        * @return If installation is succeeded, return true. if not return false.
-        * @throws IMExitException 
-        */
-       public boolean install(Collection<String> installList, String targetPath,
-                       InstallProgressMonitor monitor) throws IMExitException {
-
-               Log.log("======== Start Installing ========");
-               Log.log("ViewController install => Selected package list: " + installList);
-
-               if (packageManager == null) {
-                       Log.err("Package list does not exist.");
-                       return false;
-               }
-
-               if (installList.size() == 0) {
-                       Log.log("Package install success.");
-                       return true;
-               }
-
-               PackageSet selectedMetas = packageManager.getPackagesByNames(installList);
-               
-               //add mandotory packages
-               selectedMetas.addAll(packageManager.getMandatoryPackages());
-               
-               //get package set by pusrpose.
-               selectedMetas = getMetaPackagesByPurpose(selectedMetas);
-
-               return installManager.install(selectedMetas, targetPath, monitor);
-
-       }
-       
-       private PackageSet getMetaPackagesByPurpose(PackageSet metaPackages) {
-               for (Package pkg : metaPackages) {
-                       String attribute = pkg.getAttribute();
-                       
-                       if (!attribute.equalsIgnoreCase("root") && attribute.equals("extra")) {
-                               if (!attribute.equalsIgnoreCase(attribute)) {
-                                       metaPackages.remove(pkg);
-                               }
-                       }
-               }
-               
-               return metaPackages;
-       }
-
-       /**
-        * Start to uninstall
-        * @param uninstallList
-        * @param monitor
-        * @return If uninstallation is succeed, return true. if not return false.
-        * @see ViewController#uninstallPackages(PackageSet, IIMProgressMonitor)
-        */
-       public boolean uninstall(List<String> uninstallList, IIMProgressMonitor monitor) {
-               Log.log("ViewController Uninstall Start => " + uninstallList);
-               if (packageManager == null || uninstallList.size() == 0) {
-                       Log.err("ViewController.uninstall() uninstalllist does not exist. => " + uninstallList);
-                       ErrorController.setError(ErrorCode.ERROR);
-                       return false;
-               }
-
-               if (Options.doRemoveOldSDK || (uninstallList.size() == 1 && uninstallList.get(0).equals(Config.SDK_NAME))) {
-                       uninstallAll(monitor);
-                       return true;
-               } else {
-                       PackageSet removablePackages = packageManager.getInstalledPackagesByName(uninstallList);
-       
-                       return uninstallPackages(removablePackages, monitor);
-               }
-       }
-
-       /**
-        * Uninstall removable packages.
-        * @param removableMetapkgs
-        * @param monitor
-        * @return If removable packages can success to uninstall, return true. if not return false.
-        */
-       public boolean uninstallPackages(PackageSet removableMetapkgs, IIMProgressMonitor monitor) {
-               boolean bRet = installManager.removePackages(removableMetapkgs, monitor);
-
-               Log.log("ViewController Uninstall End => " + bRet);
-               return bRet;
-       }
-
-       /**
-        * Remove all packages.
-        * @param monitor
-        */
-       public void uninstallAll(IIMProgressMonitor monitor) {
-               Log.log("ViewController Unintall All");
-               installManager.removeAll(monitor);
-               Registry.removeRegistry();
-       }
-
-       /**
-        * Get package version that is installed already.
-        * @param pkgName is installed packages already.
-        * @return version
-        */
-       public Package getInstalledPackage(String pkgName) {
-               return packageManager.getInstalledPackageByName(pkgName);
-       }
-
-       /**
-        * Get total size depends on a package.
-        * @param packageName is string.
-        * @return size
-        */
-       public long getTotalSizeWithDepends(String packageName) {
-               Package pkg = packageManager.getPackageByName(packageName);
-               return getInstallablePackagesSize(pkg);
-       }
-
-       /**
-        * Get total size depends on a package list.
-        * @param pkgList is list.
-        * @return size
-        */
-       public long getTotalSizeWithDepends(Collection<String> pkgList) {
-               PackageSet pkgSet = packageManager.getPackagesByNames(pkgList);
-               return getTotalSizeWithDepends(pkgSet);
-       }
-
-       /**
-        * Get total size depends on a package format.
-        * @param pkg is package format.
-        * @return size
-        */
-       public long getInstallablePackagesSize(Package pkg) {
-               return packageManager.getTotalSizeOfInstallablePackages(pkg);
-       }
-       
-       /**
-        * Get total size depends on a package format.
-        * @param pkg is package format.
-        * @return size
-        */
-       public long getRemovablePackagesSize(Package pkg) {
-               return packageManager.getTotalSizeOfRemovablePackages(pkg);
-       }
-
-       /**
-        * Get total size depends on a package set.
-        * @param pkgs is package set
-        * @return size
-        */
-       public long getTotalSizeWithDepends(PackageSet pkgs) {
-               return packageManager.getTotalSizeOfInstallablePackages(pkgs);
-       }
-
-       /**
-        * Get installed path.
-        * @return Installed target path
-        */
-       public String getInstalledPath() {
-               return Registry.getInstalledPath();
-       }
-
-       /**
-        * Check to exist package which can install or remove.
-        * @return There are packages to install or remove, return true. if not false.
-        */
-       public boolean existInstallableOrRemovablePackages() {
-               return (getRemovablePackageList().size() > 0 || getInstallableOrUpdatableMetaPackages().size() > 0);
-       }
-       
-       /**
-        * Check to exist package which can install or update.
-        * @return There are packages to install or remove, return true. if not false.
-        */
-       public boolean existInstallableOrUpdatablePackages() {
-               if (Options.snapshot || Config.fromWhere == Config.ConfDialog.LOCAL_IMAGE) {
-                       return (getInstallablePackageListInSnapshot().size() > 0);
-               } else {
-                       return (getInstallableOrUpdatableMetaPackages().size() > 0);
-               }
-       }
-
-       /**
-        * Get Install configure.
-        * @return configure object.
-        */
-       public Config getConfig() {
-               return installManager.getConfig();
-       }
-
-       /**
-        * Get description of package.
-        * @param pkgName
-        * @return decription of package.
-        */
-       public String getDescription(String pkgName) {
-               Package pkg = packageManager.getPackageByName(pkgName);
-
-               if (pkg == null) {
-                       return "";
-               } else {
-                       return pkg.getDescription();
-               }
-       }
-
-       /**
-        * Check to exist files in target directory.
-        * @param targetDir is installed directory.
-        * @return If there are files in directory, return true. if not false.
-        */
-       public boolean existFilesInTargetDirectory(String targetDir) {
-               File targetFile = new File(targetDir);
-
-               if (!targetFile.exists()) {
-                       return false;
-               }
-
-               File[] targetFileList = targetFile.listFiles();
-               if (targetFileList == null || targetFileList.length <= 0) {
-                       return false;
-               } else {
-                       return true;
-               }
-       }
-
-       /**
-        * Remove file or directory from parameter
-        * @param targetPath
-        */
-       public void removeTargetPath(String targetPath) {
-               PathUtil.remove(targetPath);
-       }
-       
-       /**
-        * save information of server.
-        * @param repository Base-repository of sdk. if repository is null, it do not save repository.
-        * @param type type of repository. if type is null, it do not save type.
-        * @param packageServer package server of sdk. if packageServer is null, it do not save packageServer.
-        * @param packageType set ServerType.snapshot or ServerType.package. if serverType is null, it do not save serverType.
-        */
-       public void saveConfiguration(String repository, String distribution, ServerType packageType, String snapshotPath) {
-               Config.getInstance().saveConfiguration(repository, distribution,  packageType, snapshotPath);
-       }
-}
diff --git a/SdkImageCreator/src/org/tizen/installmanager/ui/page/WelcomePage.java b/SdkImageCreator/src/org/tizen/installmanager/ui/page/WelcomePage.java
deleted file mode 100644 (file)
index f683a43..0000000
+++ /dev/null
@@ -1,270 +0,0 @@
-/*
-*  InstallManager
-*
-* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
-*
-* Contact: 
-* Wooyoung Cho <wooyoung1.cho@samsung.com>
-* Shihyun Kim <shihyun.kim@samsung.com>
-* Taeyoung Son <taeyoung2.son@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.ui.page;
-
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.tizen.installmanager.core.Config;
-import org.tizen.installmanager.core.IMFatalException;
-import org.tizen.installmanager.core.InstallManager;
-import org.tizen.installmanager.core.Options;
-import org.tizen.installmanager.lib.ErrorController;
-import org.tizen.installmanager.lib.Log;
-import org.tizen.installmanager.pkg.lib.PackageManager;
-import org.tizen.installmanager.pkg.model.ConfigFile;
-import org.tizen.installmanager.ui.InstallManagerWindow;
-import org.tizen.installmanager.ui.dialog.ConfigurationDialog;
-
-/**
- * This class displays welcome page.
- * @author Taeyoung Son <taeyoung2.son@samsung.ncom>
- */
-public class WelcomePage extends PageTemplate {
-
-       static final String RSC_PATH_IMAGE = RESOURCE_PATH + "/install_manager_graphicmotif_welcome.png";
-       public static final String STRING_TITLE = "Welcome to Tizen SDK";
-       public static final String STRING_SUBTITLE = "Tizen SDK will be installed on your computer. " +
-                       "Close all other applications before starting the installation.";
-
-       private RADIO_ACTION selectedRadioBtn = RADIO_ACTION.INSTALL;
-       Button buttonInstall = null;
-       Button buttonUninstall = null;
-       Button configurationButton = null;
-       
-       ViewController viewController = null;
-       
-       ConfigurationDialog rDialog = null;
-       
-       public enum RADIO_ACTION {
-                       INSTALL,
-                       UNINSTALL
-       }
-
-       /**
-        * INSTALLED_NOTHING : Nothing to install before<br>
-        * INSTALLED_SOME_PACKAGES : Some packages are installed before<br>
-        * INSTALLED_ALL_PACKAGES : All packages are installed before<br>
-        * INSTALLED_AND_INSTALLABLE_NOTHING : Nothing to install before and now<br>
-        * INSTALLED_OLDSDK : There is no compatible old sdk and current sdk<br>
-        */
-       public enum InstalledStatus {
-               INSTALLED_NOTHING,
-               INSTALLED_SOME_PACKAGES,
-               INSTALLED_ALL_PACKAGES,
-               INSTALLED_AND_INSTALLABLE_NOTHING,
-               INSTALLED_OLDSDK
-       }
-
-
-       /**
-        * Create the composite.
-        * @param parent
-        * @param style
-        */
-       public WelcomePage(Composite parent, int style) {
-               super(parent, style);
-               setImageBounds(0, 0, 620, 144);
-               setTitleBounds(20, 160, 400, 20);
-               setSubTitleBounds(20, 190, 600, 40);
-               setCustomCompositeBounds(0, 220, 620, 173);
-               setLeftImageFromResource(RSC_PATH_IMAGE);
-               setTitle(STRING_TITLE);
-               setSubTitle(STRING_SUBTITLE);
-
-               setButton();
-       }
-       
-       private void setButton() {
-               setInstallButton();
-               setUninstallButton();
-               setConfigurationButton();
-       }
-       
-       private void setInstallButton() {
-               buttonInstall = new Button(customComposite, SWT.RADIO);
-               buttonInstall.setSelection(true);
-               buttonInstall.addSelectionListener(new SelectionAdapter() {
-                       @Override
-                       public void widgetSelected(SelectionEvent e) {
-                               selectedRadioBtn = RADIO_ACTION.INSTALL;
-                       }
-               });
-               buttonInstall.setBounds(26, 40, 500, 15);
-               buttonInstall.setText("Install the new " + Config.SDK_NAME + " version.");
-               buttonInstall.setBackground(InstallManagerWindow.getBackgroundColor());
-       }
-       
-       private void setUninstallButton() {
-               buttonUninstall = new Button(customComposite, SWT.RADIO);
-               buttonUninstall.addSelectionListener(new SelectionAdapter() {
-                       @Override
-                       public void widgetSelected(SelectionEvent e) {
-                               selectedRadioBtn = RADIO_ACTION.UNINSTALL;
-                       }
-               });
-               buttonUninstall.setBounds(26, 85, 500, 22);
-               buttonUninstall.setText("Uninstall the " + Config.SDK_NAME);
-               buttonUninstall.setBackground(InstallManagerWindow.getBackgroundColor());
-       }
-       
-       private void setConfigurationButton() {
-               configurationButton = new Button(customComposite, SWT.PUSH);
-               configurationButton.setText("Advanced");
-               configurationButton.setBackground(InstallManagerWindow.getBackgroundColor());
-
-               configurationButton.setBounds(509, 120, 100, 29);
-               configurationButton.addSelectionListener(new SelectionAdapter() {
-                       @Override
-                       public void widgetSelected(SelectionEvent e) {
-                               rDialog = new ConfigurationDialog(customComposite.getShell());
-                               
-                               //set information to configuration dialog.
-                               ConfigFile confFile = Config.getInstance().getConfigFile();
-                               rDialog.setRepository(confFile.getRepository());
-                               rDialog.setCurrentDistribution(confFile.getDistribution());
-                               rDialog.setSnapshotPath(confFile.getSnapshotPath());
-                               
-                               int ret = rDialog.open();
-                               if (ret == 0){
-                                       viewController.saveConfiguration(rDialog.getRepository(), rDialog.getCurrentDistribution(), rDialog.getServerType(), rDialog.getSnapshotPath());
-                                       
-                                       PackageManager.dispose();
-                                       InstallManagerWindow.getInstallManagerWindow().refresh();
-                               } else {
-                                       Log.log("Configuration dialog is canceled.");
-                               }
-                               rDialog.clear();
-                       }
-               });
-       }
-
-       /**
-        * Set install status, and set radio button.
-        * @param status
-        */
-       public void setButtonStatus() {
-               
-               if (Options.doRemoveOldSDK) {
-                       setErrorSubTitle("Old version SDK(Tizen SDK) is installed. " +
-                                       "Tizen SDK can be installed after removing old Tizen SDK.");
-                       buttonInstall.setSelection(false);
-                       buttonUninstall.setSelection(true);
-                       
-                       buttonInstall.setEnabled(false);
-                       buttonUninstall.setEnabled(true);
-
-                       selectedRadioBtn = RADIO_ACTION.UNINSTALL;
-                       return;
-               }
-               
-               if (viewController == null) {
-                       return;
-               }
-               
-               if (!viewController.existRemovablePackage()) {
-                       buttonInstall.setText("Install the new " + Config.SDK_NAME + " version.");
-                       buttonInstall.setBounds(26, 40, 500, 22);
-
-                       buttonInstall.setSelection(true);
-                       buttonUninstall.setSelection(false);
-
-                       buttonInstall.setEnabled(true);
-                       buttonUninstall.setEnabled(false);
-                       
-                       selectedRadioBtn = RADIO_ACTION.INSTALL;
-                       
-                       Config.status = Config.Status.INSTALL;
-               } else if (!viewController.existInstallableOrUpdatablePackages()) {
-                       buttonInstall.setSelection(false);
-                       buttonUninstall.setSelection(true);
-                       
-                       buttonInstall.setEnabled(false);
-                       buttonUninstall.setEnabled(true);
-
-                       selectedRadioBtn = RADIO_ACTION.UNINSTALL;
-                       
-                       Config.status = Config.Status.UNINSTALL;
-               } else {
-                       buttonInstall.setText("Install or update the " + Config.SDK_NAME);
-                       buttonInstall.setSelection(true);
-                       buttonUninstall.setSelection(false);
-                       
-                       buttonInstall.setEnabled(true);
-                       buttonUninstall.setEnabled(true);
-                       
-                       selectedRadioBtn = RADIO_ACTION.INSTALL;
-                       
-                       Config.status = Config.Status.UPDATE;
-               }
-       }
-
-       /**
-        * Get selected radio button object.
-        * @return radio button object
-        */
-       public RADIO_ACTION getSelectedRadioButton() {
-               RADIO_ACTION result = this.selectedRadioBtn;
-               return result;
-       }
-
-       /**
-        * If selection is true, button will be displayed. 
-        * @param selection
-        */
-       public void setVisibleRadioButton(boolean selection) {
-               buttonInstall.setVisible(selection);
-               buttonUninstall.setVisible(selection);
-       }
-
-       /**
-        * Set ViewController instance
-        * @param controller
-        */
-       public void setViewController(ViewController controller) {
-               if (controller != null) {
-                       viewController = controller;                    
-               } else {
-                       Log.err("viewcontroller is null.");
-                       ErrorController.setErrorMessage("Cannot initialize controller.");
-                       throw new IMFatalException("Can not read package informaion.");
-               }
-       }
-       
-       /**
-        * refresh welcome page.
-        */
-       public void refresh() {
-               InstallManager.getInstance().initPackageList();
-               setButtonStatus();
-       }
-}
diff --git a/SdkImageCreator/src/org/tizen/installmanager/util/IMShellCommandFail.java b/SdkImageCreator/src/org/tizen/installmanager/util/IMShellCommandFail.java
deleted file mode 100644 (file)
index 17e5d88..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
-*  InstallManager
-*
-* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
-*
-* Contact: 
-* Wooyoung Cho <wooyoung1.cho@samsung.com>
-* Shihyun Kim <shihyun.kim@samsung.com>
-* Taeyoung Son <taeyoung2.son@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.util;
-
-/**
- * Exception thrown when shall command fails.
- * @author Wooyoung Cho <wooyoung1.cho@samsung.com>
- *
- */
-public class IMShellCommandFail extends Exception {
-
-       private static final long serialVersionUID = 4284105845749661999L;
-
-}
diff --git a/SdkImageCreator/src/org/tizen/installmanager/util/PathUtil.java b/SdkImageCreator/src/org/tizen/installmanager/util/PathUtil.java
deleted file mode 100644 (file)
index 39f5207..0000000
+++ /dev/null
@@ -1,820 +0,0 @@
-/*
-*  InstallManager
-*
-* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
-*
-* Contact: 
-* Wooyoung Cho <wooyoung1.cho@samsung.com>
-* Shihyun Kim <shihyun.kim@samsung.com>
-* Taeyoung Son <taeyoung2.son@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.util;
-
-import java.io.*;
-import java.net.URL;
-
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Display;
-import org.tizen.installmanager.core.IMFatalException;
-import org.tizen.installmanager.lib.Log;
-import org.tizen.installmanager.lib.LoggerShellParser;
-import org.tizen.installmanager.lib.Platform;
-import org.tizen.installmanager.lib.Registry;
-import org.tizen.installmanager.lib.ErrorController.ErrorCode;
-import org.tizen.installmanager.lib.win.WindowsRegistry;
-
-
-/**
- * Common function related path.
- * @author Shiyun Kim <shihyun.kim@samsung.com>
- *
- */
-public class PathUtil {
-       
-       private final static String FILE_EXTENSION_SEPERATOR = ".";
-       private final static String DIRECTORY_SEPERATOR = "/";
-       public final static String URL_SEPERATOR = "/";
-       private final static int BUF_SIZE = 65536;
-       
-       /**
-        * Separate path from unit separator and get the back part.
-        * @param path path to separate
-        * @param Seperator unit separator
-        * @return
-        */
-       public static String getLastNameFromLastSeperator(String path, String Seperator){               
-               int lastIndex = path.lastIndexOf(Seperator);
-               
-               if (lastIndex < 0) 
-                       return path;
-               
-               return path.substring(lastIndex+1);
-       }
-       
-       /**
-        * Separate path from unit separator and get the front part.
-        * @param path path to separate
-        * @param Seperator unit separator
-        * @return
-        */
-       public static String getFirstNameFromLastSeperator(String path, String Seperator){              
-               int lastIndex = path.lastIndexOf(Seperator);
-               
-               if (lastIndex < 0) 
-                       return path;
-               
-               return path.substring(0, lastIndex);
-       }
-       
-       /**
-        * Get file extension.
-        * @param path
-        * @return file extension
-        */
-       public static String getFileExtension(String path) {
-               int lastIndex = path.lastIndexOf(FILE_EXTENSION_SEPERATOR);
-               
-               if (lastIndex < 0) 
-                       return "";
-               
-               return path.substring(lastIndex); 
-       }
-       
-       /**
-        * Get file name.
-        * @param path
-        * @return file name.
-        */
-       public static String getFileName(String path) {
-               return getLastNameFromLastSeperator(path, DIRECTORY_SEPERATOR);
-       }
-       
-       /**
-        * Get file name without extension
-        * @param path
-        * @return file name.
-        */
-       public static String getFileNameWithOutExtension(String path) {
-               String fileName = getLastNameFromLastSeperator(path, DIRECTORY_SEPERATOR);
-               
-               return getFirstNameFromLastSeperator(fileName, FILE_EXTENSION_SEPERATOR);
-       }
-       
-       /**
-        * Get parent directory.
-        * @param path
-        * @return Parent directory path
-        */
-       public static String getParentDirectory(String path) {
-               return PathUtil.getFirstNameFromLastSeperator(path, DIRECTORY_SEPERATOR);
-       }
-       
-       /**
-        * Get parent directory with parent depth.
-        * If you set <code>parentDepth=3</code>, you can get 3rd parent directory.
-        * @param path
-        * @param parentDepth depth of parent directory.
-        * @return
-        */
-       public static String getParentDirectory(String path, int parentDepth) {
-               for (int i=parentDepth; i>0; i--) {
-                       path = PathUtil.getParentDirectory(path);
-               }
-               return path;
-       }
-
-       /**
-        * hard link files instead of copying for merging existed 'toFile' side directory.
-        * @param fromFile
-        * @param toFile
-        * @return
-        */
-       public static boolean copyHardLink(File fromFile, File toFile) {
-               Log.log("Copy from " + fromFile + " to " + toFile);
-               String fromPath = fromFile.getAbsolutePath();
-               String toPath = toFile.getAbsolutePath();
-               String command[] = null;
-               
-               command = getCopyShellCommand(fromPath, toPath);
-
-               try {
-                       ShellUtil.execute(command);
-               } catch (IMShellCommandFail e) {
-                       Log.err("Failed to copy " + fromFile + "to" + toFile);
-                       Log.ExceptionLog(e);
-                       return false;
-               }
-               
-               return true;
-       }
-       
-       private static String[] getCopyShellCommand(String fromPath, String toPath) {
-               if (Platform.CURRENT_PLATFORM == Platform.LINUX_32
-                               || Platform.CURRENT_PLATFORM == Platform.LINUX_64) {
-                       String command[] = {"cp", "-rl", fromPath, toPath};
-                       return command;
-               } else if (Platform.CURRENT_PLATFORM == Platform.MACOS_64) {
-                       String command[] = {"cp", "-a", fromPath, toPath};
-                       return command;
-               } else {
-                       return null;
-               }
-       }
-       
-       //Copy file
-       /**
-        * copy file or directory.
-        * @param from source file path
-        * @param to destination file path
-        * @return
-        * @throws IOException
-        */
-       public static boolean copy(String from, String to) throws IOException {
-               return copy(new File(from), new File(to));
-       }
-       
-       /**
-        * copy file or directory.
-        * @param from source file
-        * @param to destination file
-        * @return
-        * @throws IOException
-        */
-       public static boolean copy(File fromFile, File toFile) throws IOException {
-               Log.log("Copy from "+fromFile+" to "+toFile);
-               if (!fromFile.exists() /*|| !fromFile.getName().equals(toFile.getName())*/) {
-                       Log.log("Copy failed");
-                       return false;
-               }
-               
-               if (!fromFile.isDirectory()) {
-                       if (toFile.exists()) {
-                               toFile.delete();
-                       }
-                       
-                       return copyFile(fromFile, toFile);
-               }
-               
-               if (toFile.exists()) {
-                       return true;
-               }
-               
-               toFile.mkdirs();
-               
-               File[] fileList = fromFile.listFiles();
-               if (fileList == null || fileList.length == 0) {
-                       return true;
-               }
-               
-               for (int i=0; i<fileList.length; i++) {
-                       copy(fileList[i], new File(toFile.getAbsolutePath() + File.separator + fileList[i].getName()));
-               }
-               return true;
-       }
-       
-       /**
-        * copy file.
-        * @param from source file
-        * @param to destination file
-        * @return
-        * @throws IOException
-        */
-       private static boolean copyFile(File from, File to) throws IOException {
-               if (!from.exists()) {
-                       return false;
-               }
-               
-               if (!to.exists()) {
-                       to.createNewFile();
-               }
-               
-               FileInputStream fInput = null;
-               FileOutputStream fOutput = null;
-               try {
-                       fInput = new FileInputStream(from);
-                       fOutput = new FileOutputStream(to);
-                       
-                       int readSize = 0;
-                       byte[] buf = new byte[BUF_SIZE];
-                       while((readSize = fInput.read(buf, 0, BUF_SIZE)) != -1) {
-                               fOutput.write(buf, 0, readSize);
-                       }
-                       
-                       return true;
-               } catch (FileNotFoundException e) {
-                       throw new IMFatalException(ErrorCode.COPY_FILE_IS_FAIL);
-               } catch (IOException e) {
-                       throw new IMFatalException(ErrorCode.COPY_FILE_IS_FAIL);
-               } finally {
-                       try {
-                               if (fInput != null) {
-                                       fInput.close();
-                               }
-                       } catch (IOException e) {
-                               Log.ExceptionLog(e);
-                       }
-                       
-                       try {
-                               if (fOutput != null) {
-                                       fOutput.close();
-                               }
-                       } catch (IOException e) {
-                               Log.ExceptionLog(e);
-                       }
-               }
-       }
-       
-       /**
-        * write to file from input stream.
-        * @param is input stream to write.
-        * @param to written file.
-        * @throws IOException
-        */
-       public static void writeFileFromInputStream(InputStream is, File to) throws IOException {
-               Log.log("write file from input stream to : "+to);
-               
-               if (is == null) {
-                       return;
-               }
-               if (!to.exists()) {
-                       to.createNewFile();
-               }
-               FileOutputStream os = null;
-               try {
-                       os = new FileOutputStream(to);
-
-                       int readSize = 0;
-                       byte[] buf = new byte[BUF_SIZE];
-                       while((readSize = is.read(buf, 0, BUF_SIZE)) != -1) {
-                               os.write(buf, 0, readSize);
-                       }
-               } catch (FileNotFoundException e) {
-                       Log.err("Cannot find file "+to);
-                       throw new IMFatalException(ErrorCode.CANNOT_ACCESS_FILE);
-               } finally {
-                       try {
-                               if (is != null) {
-                                       is.close();
-                               }               
-                       } catch (IOException e) {
-                               Log.ExceptionLog(e);
-                       }
-                       
-                       try {
-                               if (os != null) {
-                                       os.close();
-                               }                               
-                       } catch (IOException e) {
-                               Log.ExceptionLog(e);
-                       }
-               }
-       }
-       
-       //Move file
-       /**
-        * move file.
-        * @param fromFile origin file
-        * @param toFile destination file.
-        * @return
-        */
-       public static boolean moveFile(File fromFile, File toFile) {
-               
-       File parentDir = toFile.getParentFile();
-       if (!parentDir.exists()) {
-               parentDir.mkdirs();
-       }
-       return move(fromFile, toFile);
-    }
-       
-       /**
-        * move file.
-        * @param fromFile origin file
-        * @param toFile destination file.
-        * @return
-        */
-    public static boolean move(File fromFile, File toFile) {
-       Log.log("Move from "+fromFile+" to "+toFile);
-       if (!fromFile.exists()) {
-               Log.err(fromFile+" not exists");
-               return false;
-       }
-       
-        if (toFile.exists()) {
-               if (toFile.isFile()) {
-                       toFile.delete();
-                       return fromFile.renameTo(toFile);
-               } else {
-                   File[] files = fromFile.listFiles();
-                   if (files == null) {
-                       return true;
-                   }
-                   for(int i=0; i<files.length; i++) {
-                       move(files[i], new File(toFile, files[i].getName()));
-                   }
-                   return true;
-               }
-        } else {
-               return fromFile.renameTo(toFile);
-        }
-    }
-    
-    /**
-     * Remove given file. If it's directory, remove every files and directories in it recursively.
-     * @param path file path to remove.
-     * @return
-     */
-    public static boolean remove(String path) {
-               return remove(new File(path));
-       }
-       
-    /**
-     * Remove given file. If it's directory, remove every files and directories in it recursively.
-     * @param file filePath File or directory to remove.
-     * @return <code>true</code> if success
-     */
-       public static boolean remove(File file) {
-               if (Platform.CURRENT_PLATFORM == Platform.LINUX_32
-                               || Platform.CURRENT_PLATFORM == Platform.LINUX_64
-                               || Platform.CURRENT_PLATFORM == Platform.MACOS_64) {
-                       return removeForLinux(file);
-               } else if (Platform.CURRENT_PLATFORM == Platform.WINDOWS_32
-                               || Platform.CURRENT_PLATFORM == Platform.WINDOWS_64) {
-                       return removeForWindows(file);
-               } else {
-                       throw new IMFatalException(ErrorCode.UNSUPPORTED_PLATFORM);
-               }
-       }
-       
-       /**
-        * Remove given file by bash command in linux system. If it's directory, remove every files and directories in it recursively.
-     * @param filePath filePath File or directory to remove.
-     * @return <code>true</code> if success
-        */
-       private static boolean removeForLinux(File filePath) {
-               try {
-                       int exitCode = ShellUtil.execute(
-                                       "rm -rf " + filePath.getAbsolutePath(), new LoggerShellParser());
-                       return (exitCode == 0);
-               } catch (IMShellCommandFail e) {
-                       return false;
-               }
-       }
-       
-       /**
-        * Remove given file in windows system. If it's directory, remove every files and directories in it recursively.
-        * Remove continuously regardless of fail.
-     * @param filePath File or directory to remove.
-     * @return <code>true</code> if all of files are removed or target file to remove does not exist.
-        */
-       private static boolean removeForWindows(File filePath) {
-               boolean ret = true;
-               if (!filePath.exists()) {
-                       return true;
-               }
-
-               if (filePath.isDirectory()) {
-                       File[] listFile = filePath.listFiles();
-                       
-                       for (File childFile : listFile) {
-                               ret = removeForWindows(childFile) && ret;
-                       }
-
-               } else {}//filePath is file.
-               
-               System.gc(); // delete() method does not work exactly sometimes. so, there is gc() before delete().
-               return filePath.delete() && ret;
-       }
-       
-       public static File makeNewFile(String filePath) throws IOException{
-               File file = new File(filePath);
-               if (file.exists()) {
-                       if (!file.delete()) {
-                               return null;
-                       }
-               }
-               
-               File parentDir = file.getParentFile();
-               if (!parentDir.exists()) {
-                       if (!parentDir.mkdirs()) {
-                               return null;
-                       }
-               }
-
-               if (!file.createNewFile()) {
-                       return null;
-               }
-               
-               return file;
-       }
-       
-       /**
-        * Make hidden file.
-        * @param file
-        * @return
-        */
-       public static boolean makeHiddenFile(String file) {
-               if (Platform.CURRENT_PLATFORM == Platform.WINDOWS_32
-                               || Platform.CURRENT_PLATFORM == Platform.WINDOWS_64) {
-               String[] command = {"c:\\windows\\system32\\attrib.exe", 
-                                                       "+H", 
-                                                       file};
-               
-               try {
-                               return (ShellUtil.execute(command) == 0);
-                       } catch (IMShellCommandFail e) {
-                               return false;
-                       }
-       } else if (Platform.CURRENT_PLATFORM == Platform.LINUX_32
-                       || Platform.CURRENT_PLATFORM == Platform.LINUX_64
-                       || Platform.CURRENT_PLATFORM == Platform.MACOS_64) {
-               return true;
-       } else {
-               throw new IMFatalException(ErrorCode.UNSUPPORTED_PLATFORM);
-       }
-       }
-
-       /**
-        * Make hidden file.
-        * @param file
-        * @return
-        * @throws IOException
-        */
-       public static boolean makeHiddenFile(File file) throws IOException{
-               return makeHiddenFile(file.getCanonicalPath());
-       }
-       
-       /**
-        * @param path_components the path components
-        * @return a path string made by concatenating the path components. empty string if there are no path components.
-        */
-       public static String get(String... path_components) {
-               String path = "";
-               
-               for(int i = 0; i < path_components.length; i++) {
-                       if( i == 0 ) {
-                               path = path_components[0];
-                       } else {
-                               path = path + File.separator + path_components[i];
-                       }
-               }
-               return path;
-       }
-       
-       /**
-        * @param path_components the path components
-        * @return a path string made by concatenating the path components. empty string if there are no path components.
-        */
-       public static String addURLPath(String... path_components) {            
-               if (path_components == null) {
-                       return "";
-               }
-               
-               String path = "";               
-               for(int i = 0; i < path_components.length; i++) {
-                       if (path_components[i] == null || path_components[i].isEmpty()) {
-                               continue;
-                       }
-                       if( i == 0 ) {
-                               path = path_components[0];
-                       } else {
-                               path = path + PathUtil.URL_SEPERATOR + path_components[i];
-                       }
-               }
-               return path;
-       }
-       
-       /**
-        * @param path_components
-        * @return a path string made by the path components relative to the home directory
-        */
-       public static String getFromHome(String... path_components) {
-               return System.getProperty("user.home") + File.separator + get(path_components);
-       }
-       
-       /**
-        * @param path_components
-        * @return a path string made by the path components relative to the install path. empty string if install path not found 
-        */
-       public static String getFromInstalledPath(String... path_components) {
-               String installPath = Registry.getInstalledPath();
-               if(installPath.equals("")) {
-                       return "";
-               } else {
-                       return installPath + File.separator + get(path_components);
-               }
-       }
-       
-       /** 
-        * @return current working directory.
-        */
-       public static String getCurrentDir() {
-               return System.getProperty("user.dir");
-       }
-       
-       /**
-        * @param path_components
-        * @return a path string made by the path components relative to the current working directory
-        */
-       public static String getFromCurrDir(String... path_components) {
-               return PathUtil.get(getCurrentDir(), get(path_components)); 
-       }
-       
-       /**
-        * get temp directory
-        * @return
-        */
-       public static String getTempDir() {
-               return System.getProperty("java.io.tmpdir");
-       }
-       
-       /**
-        * 
-        * @param path_components
-        * @return
-        */
-       public static String getFromTempDir(String... path_components) {
-               return PathUtil.get(getTempDir() + File.separator + get(path_components));
-       }
-       
-       /**
-        * Get LocalAppData Path.
-        * @return
-        */
-       public static String getLocalAppData() {
-               if (Platform.isWindows()) {
-                       return WindowsRegistry.getRegistryValue(
-                                                      WindowsRegistry.REGISTRY_PATH_OF_SHELL_FOLDER
-                                                      , WindowsRegistry.REGISTRY_LOCAL_APP_DATA_OF_SHELL_FOLDER);
-               } else {
-                       return "";
-               }
-       }
-       
-       /**
-        * Get path from AppData
-        * @param path_components
-        * @return
-        */
-       public static String getFromAppData(String... path_components) {
-               return PathUtil.get(getLocalAppData() + File.separator + get(path_components));
-       }
-       /**
-        * @param resourcePath
-        * @return string of whole content of the resource in UTF-8 charset
-        */
-       public static String readAllTextFromResource(String resourcePath) {
-               InputStream is = null;
-               StringBuffer txt = new StringBuffer();
-               is = PathUtil.getResourceAsStream(resourcePath);
-               BufferedReader in = null;
-               
-               try {
-                       in = new BufferedReader(new InputStreamReader(is, "UTF-8"));
-                       String strLicense;
-                       while((strLicense = in.readLine()) != null) {
-                               txt.append(strLicense);
-                               txt.append("\n");
-                       }
-               } catch(IOException e) {
-                       throw new IMFatalException("Cannot read resource: "+resourcePath);
-               } finally {
-                       try {
-                               if (in != null) {
-                                       in.close();
-                               }
-                       } catch (IOException e) {
-                               Log.ExceptionLog(e);
-                       }
-               }
-               
-               return txt.toString();
-       }
-       
-       /**
-        * Read text from file.
-        * @param filePath target file.
-        * @return StringBuffer instance that contains whole text from <code>filePath</code>.
-        */
-       public static String readAllTextFromFile(String filePath) {
-               StringBuffer txt = new StringBuffer();
-               InputStream is = null;
-               BufferedReader in = null;
-               try {
-                       is = new FileInputStream(filePath);
-                       in = new BufferedReader(new InputStreamReader(is, "UTF-8"));
-                       String strLicense;
-                       while((strLicense = in.readLine()) != null) {
-                               txt.append(strLicense);
-                               txt.append("\n");
-                       }
-               } catch(IOException e) {
-                       throw new IMFatalException("Cannot read resource: " + filePath);
-               } finally {
-                       try {
-                               if (in != null) {
-                                       in.close();                                     
-                               }
-                       } catch (IOException e) {
-                               Log.ExceptionLog(e);
-                       }
-                       
-                       try {
-                               if (is != null) {
-                                       is.close();                                     
-                               }
-                       } catch (IOException e) {
-                               Log.ExceptionLog(e);
-                       }
-               }
-               return txt.toString();
-       }
-
-       /**
-        * @param resourcePath
-        * @return URL of the resource. This URL does not mean a file. It just shows how to locate the resource.  
-        */
-       public static URL getResourceUrl(String resourcePath) {
-               return Class.class.getResource(resourcePath);
-       }
-       /**
-        * @param resourcePath
-        * @return input stream of the resource.
-        */
-       public static InputStream getResourceAsStream(String resourcePath) {
-               return Class.class.getResourceAsStream(resourcePath);
-       }
-       
-       /**
-        * Writes the text in UTF-8 to the file.
-        * @param text UTF-8 string to be written 
-        * @param toFile
-        * @throws IOException
-        */
-       public static void writeStringToFile(String text, File toFile) throws IOException {
-        try {
-            InputStream is = new ByteArrayInputStream(text.getBytes("UTF-8"));
-            PathUtil.writeFileFromInputStream(is, toFile);
-        } catch (UnsupportedEncodingException e) {
-            throw new IMFatalException("Unsupported encoding UTF-8");
-        }
-       }
-       
-       /**
-        * @param resourcePath
-        * @return image object made of the resource
-        */
-       public static Image getImageFromResource(String resourcePath) {
-               return new Image(Display.getCurrent(), PathUtil.getResourceAsStream(resourcePath));
-       }
-       
-       /**
-        * Create a temp file whose content is from the resource. The temp file will be removed automatically after install manager exits.
-        * @param resourcePath
-        * @param prefix prefix of the temp file name. should be at least 3 characters
-        * @param suffix suffix of the temp file name
-        * @return temp file whose content is from the resource.
-        * @throws IOException
-        */
-       public static File getTempFileFromResource(String resourcePath, String prefix, String suffix) throws IOException {
-               return getTempFileFromResource(resourcePath, prefix, suffix, true);
-       }
-       
-       /**
-        * Create a temp file whose content is from the resource. The temp file will be removed automatically after install manager exits.
-        * @param resourcePath
-        * @param prefix prefix of the temp file name. should be at least 3 characters
-        * @param suffix suffix of the temp file name
-        * @param deleteOnExit if set <code>true</code>, delete on exit.
-        * @return temp file whose content is from the resource.
-        * @throws IOException
-        */
-       public static File getTempFileFromResource(String resourcePath, String prefix, String suffix, boolean deleteOnExit) throws IOException {
-               File file = File.createTempFile(prefix, suffix);
-               PathUtil.writeFileFromInputStream(PathUtil.getResourceAsStream(resourcePath), file);
-               
-               if(deleteOnExit) {
-                       file.deleteOnExit();
-               }
-               
-               return file;
-       }
-       
-       /**
-        * Copy the resource to the file
-        * @param resourcePath
-        * @param toFile
-        * @return <code>true</code> if succeed
-        * @throws IOException
-        */
-       public static boolean copyFileFromResource(String resourcePath, File toFile) throws IOException {
-               Log.log("copy file from resource: "+resourcePath + " -> " + toFile);
-               if(toFile.exists()) {
-                       if(!toFile.delete()) {
-                               return false;
-                       }
-               }
-               if(!toFile.createNewFile())
-                       return false;
-               
-               PathUtil.writeFileFromInputStream(PathUtil.getResourceAsStream(resourcePath), toFile);
-               return true;
-       }
-       
-       /**
-        * Moves the file of path <code>fromFilePath</code> to the file of path <code>toFilePath</code>
-        * @param fromFilePath
-        * @param toFilePath
-        */
-       public static void moveFile(String fromFilePath, String toFilePath) {
-               PathUtil.moveFile(new File(fromFilePath), new File(toFilePath));
-       }
-       
-       /**
-        * Get parent path of temporary file.(makeshortcut script, Packages list, Installer log)
-        * @return parent path of temporary file
-        */
-       public static String getTempFileParent() {
-               try {
-                       File tmp = File.createTempFile("tizen_installmanager", ".tmp");
-                       tmp.deleteOnExit();
-                       return tmp.getParent();
-               } catch (IOException e) {
-                       throw new IMFatalException("Cannot create file");
-               }
-       }
-       
-//     public static URL addURLPath(URL url, String additionalPath) {
-//             return addURLPath(url.toExternalForm(), additionalPath);
-//     }
-//     
-//     public static URL addURLPath(String url, String additionalPath) {
-//             if (url == null || url.isEmpty()) {
-//                     return null;
-//             } else {
-//                     try {
-//                             return new URL(url + "/" + additionalPath);
-//                     } catch (MalformedURLException e) {
-//                             Log.err("Cannot add url path." + url + " + " + additionalPath);
-//                             return null;
-//                     } 
-//             }
-//     }
-}
diff --git a/SdkImageCreator/src/org/tizen/installmanager/util/ShellUtil.java b/SdkImageCreator/src/org/tizen/installmanager/util/ShellUtil.java
deleted file mode 100644 (file)
index 4003dce..0000000
+++ /dev/null
@@ -1,206 +0,0 @@
-/*
- *  InstallManager
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: 
- * Wooyoung Cho <wooyoung1.cho@samsung.com>
- * Shihyun Kim <shihyun.kim@samsung.com>
- * Taeyoung Son <taeyoung2.son@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.util;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.Arrays;
-import java.util.Map;
-import java.util.StringTokenizer;
-
-import org.tizen.installmanager.lib.Log;
-import org.tizen.installmanager.lib.LoggerShellParser;
-import org.tizen.installmanager.lib.ShellParser;
-
-/**
- * Utility methods for executing shell commands
- * 
- * @author Wooyoung Cho <wooyoung1.cho@samsung.com>
- * 
- */
-public class ShellUtil {
-
-       private ShellUtil() {
-       }
-
-       public static int execute(String cmd) throws IMShellCommandFail {
-               return execute(cmd, null, null, new LoggerShellParser());
-       }
-
-       public static int execute(String cmd, ShellParser parser)
-                       throws IMShellCommandFail {
-               return execute(cmd, null, null, parser);
-       }
-
-       public static int execute(String[] command) throws IMShellCommandFail {
-               return execute(command, null, null, new LoggerShellParser());
-       }
-
-       public static int execute(String[] command, ShellParser parser)
-                       throws IMShellCommandFail {
-               return execute(command, null, null, parser);
-       }
-
-       public static int execute(String cmd, Map<String, String> env,
-                       File workingDir, ShellParser parser) throws IMShellCommandFail {
-               StringTokenizer token = new StringTokenizer(cmd);
-
-               int length = token.countTokens();
-               String command[] = new String[length];
-
-               for (int i = 0; i < length; i++) {
-                       command[i] = token.nextToken();
-               }
-               return execute(command, env, workingDir, parser);
-       }
-
-       /**
-        * Executes the shell command synchronously with the environment in the dir.
-        * 
-        * @param cmd
-        * @param env
-        * @param workingDir
-        * @return process object if success. null if failed.
-        * @throws IMShellCommandFail
-        */
-       public static int execute(String cmd[], Map<String, String> env,
-                       File workingDir, ShellParser parser) throws IMShellCommandFail {
-
-               Log.log("execute command => " + Arrays.toString(cmd));
-               ProcessBuilder pb = new ProcessBuilder(cmd);
-
-               if (env != null) {
-                       Map<String, String> pbEnv = pb.environment();
-                       pbEnv.putAll(env);
-               }
-
-               if (workingDir != null) {
-                       pb.directory(workingDir);
-               }
-
-               Process proc = null;
-               try {
-                       proc = pb.start();
-                       if (parser != null) {
-                               parser.runParsing(proc);
-                       }
-                       int exitCode = proc.waitFor();
-                       Log.log("Command exit code => " + exitCode);
-                       
-                       return exitCode;
-               } catch (IOException e) {
-                       Log.err("Command exec error => " + Arrays.toString(cmd));
-                       throw new IMShellCommandFail();
-               } catch (InterruptedException e) {
-                       Log.err("Command exec error => " + Arrays.toString(cmd));
-                       throw new IMShellCommandFail();
-               }
-       }
-
-       /**
-        * Executes shell command and return without waiting for exiting.
-        * 
-        * @param cmd
-        * @return process object of the execution. <code>null</code> if
-        *         <code>IOException</code> occurrs.
-        */
-       public static Process asyncExecute(String cmd) {
-               return asyncExecute(cmd, null, null, new ShellParser(false));
-       }
-
-       /**
-        * Executes shell command and return without waiting for exiting.
-        * 
-        * @param cmd
-        *            executable command
-        * @param env
-        *            environment variable
-        * @param workingDir
-        *            working directory
-        * @param parser
-        *            ShellParser instance that can process stdout and stderr.
-        * @return process object of the execution. <code>null</code> if
-        *         <code>IOException</code> occurrs.
-        */
-       public static Process asyncExecute(String cmd, Map<String, String> env,
-                       File workingDir, ShellParser parser) {
-               Log.log("command exec = > " + cmd);
-
-               StringTokenizer token = new StringTokenizer(cmd);
-
-               int length = token.countTokens();
-               String command[] = new String[length];
-
-               for (int i = 0; i < length; i++) {
-                       command[i] = token.nextToken();
-               }
-
-               ProcessBuilder pb = new ProcessBuilder(command);
-               // set working directory
-               if (workingDir != null) {
-                       pb.directory(workingDir);
-               }
-
-               // set environment variable
-               if (env != null) {
-                       Map<String, String> pbEnv = pb.environment();
-                       pbEnv.putAll(env);
-               }
-
-               try {
-                       Process proc = pb.start();
-                       parser.runParsing(proc);
-
-                       return proc;
-               } catch (IOException e) {
-                       Log.ExceptionLog(e);
-                       return null;
-               }
-       }
-       
-       /**
-        * Add interpreter from extension.
-        * If extension is ".vbs", add "wscript.exe " in front of command 
-        * If extensino is ".bat", add "cmd.exe /C " in front of command 
-        * @param command
-        * @return combined command of interpreter.
-        */
-       public static String addInterpreter(String command) {
-               String extension = PathUtil.getFileExtension(command);
-               
-               if (extension.equalsIgnoreCase(".vbs")) {
-                       command = "wscript.exe " + command;
-               } else if (extension.equalsIgnoreCase(".bat")) {
-                       command = "cmd.exe /C " + command;
-               } else {}
-       
-               return command;
-    }
-
-}
diff --git a/SdkImageCreator/src/res/COPYING b/SdkImageCreator/src/res/COPYING
deleted file mode 100644 (file)
index 74375c3..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-                                                        
-Tizen SDK
-                                                        
-Tizen SDK contains software portions licensed under various open source licenses as well as proprietary components.  All open source software portions (“Open Source Software”) are licensed under the open source licenses that accompany such Open Source Software.  
-
-The licenses governing the Open Source Software are available at: http://developer.tizen.org/download/tizen_sdk_opensource_license.html
-
-Except for the Open Source Software contained in Tizen SDK, all other software portions contained in Tizen SDK are governed by the terms and conditions of the Tizen Software Development Kit License Agreement, available at: http://developer.tizen.org/download/samsung_sdk_license.html
-
-You may access and download Tizen SDK Open Source Software at: http://developer.tizen.org/download/tizenopensdk.tar.gz
-
-BY CLICKING THE "I AGREE" BUTTON OR BY USING ANY PART OF TIZEN SDK, YOU AGREE (ON BEHALF OF YOURSELF AND/OR YOUR COMPANY) TO THE OPEN SOURCE SOFTWARE LICENSE TERMS AND THE TIZEN SOFTWARE DEVELOPMENT KIT LICENSE AGREEMENT. If you do not agree with the Open Source Software license terms or the TIZEN SOFTWARE DEVELOPMENT KIT LICENSE AGREEMENT, you may not download or use Tizen SDK.
\ No newline at end of file
diff --git a/SdkImageCreator/src/res/desktop_directory/ExecuteInstallManager.vbs b/SdkImageCreator/src/res/desktop_directory/ExecuteInstallManager.vbs
deleted file mode 100644 (file)
index 7e74a68..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-Dim oShell\r
-set oShell = WScript.CreateObject ("WScript.shell")\r
-oShell.Run "java -jar InstallManager.jar", 0
\ No newline at end of file
diff --git a/SdkImageCreator/src/res/desktop_directory/checkJavaInstallation.sh b/SdkImageCreator/src/res/desktop_directory/checkJavaInstallation.sh
deleted file mode 100644 (file)
index c2e6d26..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/bash -x
-
-which java
-
-exit $?
diff --git a/SdkImageCreator/src/res/desktop_directory/checkRunningTaskList.vbs b/SdkImageCreator/src/res/desktop_directory/checkRunningTaskList.vbs
deleted file mode 100644 (file)
index f3e1348..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-' Print absolute paths of executables of all processes
-
-strComputer = "." 
-
-' Get WMI Service object
-Set objWMIService = GetObject("winmgmts:" _
-    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
-
-' Get all process list
-Set colProcessList = objWMIService.ExecQuery _
-    ("Select * from Win32_Process")
-
-' Get Debug privilege
-Set Service = GetObject( _
-    "winmgmts:{impersonationLevel=impersonate, (Debug)}")
-
-' Print process information
-For Each objProcess in colProcessList
-    Wscript.Echo ( objProcess.ProcessId & " " & objProcess.ExecutablePath)
-    
-Next
diff --git a/SdkImageCreator/src/res/desktop_directory/install.sh b/SdkImageCreator/src/res/desktop_directory/install.sh
deleted file mode 100644 (file)
index 8e71ad2..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-#!/bin/bash -x
-
-SHORTCUT_DIR_PATH=${HOME}/.local/share
-MENU_DIRECTORY_PATH=${SHORTCUT_DIR_PATH}/desktop-directories
-MENU_FILE_PATH=${MENU_DIRECTORY_PATH}/tizen-sdk-menu.directory
-MENU_ICON_FILE_PATH=${INSTALLED_PATH}/install-manager/tizen-sdk-menu.png
-MENU_NAME="Tizen SDK"
-MENU_COMMENT="Tizen SDK"
-MENU_VERSION=1.0
-PARTNER=${PARTNER_SDK}
-
-##if not exist 'desktop-directories' directory
-if [ ! -e ${MENU_DIRECTORY_PATH} ]; then
-       mkdir ${MENU_DIRECTORY_PATH}
-fi
-
-if [ -e ${MENU_FILE_PATH} ]; then
-       rm -rf ${MENU_FILE_PATH}
-fi
-
-##create 'Tizen SDK' menu
-cat >> ${MENU_FILE_PATH} << END
-[Desktop Entry]        
-Type=Directory
-Version=${MENU_VERSION}
-Name=${MENU_NAME}
-Comment=${MENU_COMMENT}
-Icon=${MENU_ICON_FILE_PATH}
-END
-
-APPLICATION_DIR_PATH=${SHORTCUT_DIR_PATH}/applications
-DESKTOP_FILE_PATH=${APPLICATION_DIR_PATH}/tizen-sdk-installmanager.desktop
-if [ -n "${PARTNER}" ] ; then
-       DESKTOP_EXECUTE_FILE_PATH=${INSTALLED_PATH}/install-manager/InstallManagerP
-else
-       DESKTOP_EXECUTE_FILE_PATH=${INSTALLED_PATH}/install-manager/InstallManager
-fi
-DESKTOP_ICON_FILE_PATH=${INSTALLED_PATH}/install-manager/tizen-sdk-installmanager.png
-DESKTOP_NAME="Install Manager"
-DESKTOP_COMMENT="Install Manager for Tizen SDK"
-
-##if not exist 'applications' directory
-if [ ! -e ${APPLICATION_DIR_PATH} ]; then
-       mkdir ${APPLICATION_DIR_PATH}
-fi
-
-##create 'Install Manager' shortcut
-${MAKESHORTCUT_PATH} \
--f "${DESKTOP_FILE_PATH}" \
--e "${DESKTOP_EXECUTE_FILE_PATH}" \
--i "${DESKTOP_ICON_FILE_PATH}" \
--n "${DESKTOP_NAME}" \
--c "${DESKTOP_COMMENT}"
-
diff --git a/SdkImageCreator/src/res/desktop_directory/install.vbs b/SdkImageCreator/src/res/desktop_directory/install.vbs
deleted file mode 100644 (file)
index e611153..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-Set wshShell = Wscript.CreateObject("Wscript.Shell")\r
-programsPath = wshShell.SpecialFolders("Programs")\r
-TizenSDKPath = programsPath & "\Tizen SDK"\r
-\r
-'create Tizen SDK directory in Programs special folder\r
-Set objFSO = CreateObject("Scripting.FileSystemObject")\r
-\r
-if not objFSO.FolderExists(TizenSDKPath) then\r
-       objFSO.CreateFolder(TizenSDKPath)\r
-end if\r
-\r
-Set WshEnv = wshShell.Environment("Process")\r
-installedPath = WshEnv("INSTALLED_PATH")\r
-makeShortcutPath = WshEnv("MAKESHORTCUT_PATH")\r
-partner = WshEnv("PARTNER_SDK")\r
-targetPath = installedPath & "\install-manager\InstManager.exe"\r
-iconPath = installedPath & "\install-manager\tizen-sdk-installmanager.ico"\r
-shortcutName = "Install Manager"\r
-wshShell.Run "wscript.exe " & chr(34) & makeShortcutPath & chr(34) & " /target:" & chr(34) & targetPath & chr(34) & " /icon:" & chr(34) & iconPath & chr(34) & " /shortcut:" & chr(34) & shortcutName & chr(34)\r
diff --git a/SdkImageCreator/src/res/desktop_directory/makeshortcut.sh b/SdkImageCreator/src/res/desktop_directory/makeshortcut.sh
deleted file mode 100644 (file)
index 19a8b68..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-#!/bin/bash -x
-
-MENU_DIRECTORY_PATH=${HOME}/.local/share/desktop-directories/tizen-sdk-menu.directory
-
-SHORTCUT_FILE_PATH=
-EXEC_FILE_PATH=
-ICON_PATH=
-
-NAME=
-COMMENT=
-
-parseParameter()
-{
-       while [ $# -gt 0 ]
-       do
-               case $1 in
-                       -f|--filepath)
-                               shift
-                               SHORTCUT_FILE_PATH=$1
-                               ;;
-                       -e|--executefilepath)
-                               shift
-                               EXEC_FILE_PATH=$1
-                               ;;
-                       -i|--iconpath)
-                               shift
-                               ICON_PATH=$1
-                               ;;
-                       -n|--name)
-                               shift
-                               NAME=$1
-                               ;;
-                       -c|--comment)
-                               shift
-                               COMMENT=$1
-                               ;;
-                       *)
-                               exit 12
-                               ;;
-               esac
-               shift
-       done
-}
-
-##exist unconditionally
-checkParameter()
-{      
-       if [ ! -e ${EXEC_FILE_PATH} ]; then
-               exit 13
-       fi
-       
-       if [ ! -e ${ICON_PATH} ]; then
-               exit 13
-       fi
-}
-
-makeShortcut()
-{
-       checkParameter
-       
-       UBUNTU_VER=`awk 'BEGIN {FS="="}; /DISTRIB_RELEASE.*/ {print $2}' /etc/lsb-release`
-
-       case ${UBUNTU_VER} in
-               11.04)
-                       categories="Tizen SDK;Development;"
-                       ;;
-               11.10)
-                       categories="Tizen SDK;Development;"
-                       ;;
-               *)
-                       categories="Tizen SDK"
-                       ;;
-       esac
-
-       if [ -e ${SHORTCUT_FILE_PATH} ]; then
-               rm -rf ${SHORTCUT_FILE_PATH}
-       fi
-
-       ## Create .desktop file 
-       mkdir -p ${HOME}/.local/share/applications
-       cat >> ${SHORTCUT_FILE_PATH} << END
-[Desktop Entry]
-Encoding=UTF-8
-Version=1.0
-Type=Application
-Terminal=false
-Comment=${COMMENT} 
-Name=${NAME}
-Categories=$categories
-StartupNotify=true
-NoDisplay=false
-Icon=${ICON_PATH}
-Exec=${EXEC_FILE_PATH}
-END
-
-       ## Register .desktop file
-       xdg-desktop-menu install ${MENU_DIRECTORY_PATH} ${SHORTCUT_FILE_PATH}
-}
-
-parseParameter "$@"
-makeShortcut
diff --git a/SdkImageCreator/src/res/desktop_directory/makeshortcut.vbs b/SdkImageCreator/src/res/desktop_directory/makeshortcut.vbs
deleted file mode 100644 (file)
index ad042b4..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-set WshShell = WScript.CreateObject("WScript.Shell")\r
-\r
-programsPath = wshShell.SpecialFolders("Programs")\r
-TizenSDKPath = programsPath & "\Tizen SDK"\r
-linkFilePath = TizenSDKPath & "\" & Wscript.Arguments.Named("shortcut") & ".lnk"\r
-\r
-set filesys = CreateObject("Scripting.FileSystemObject")\r
-filename = Wscript.Arguments.Named("target")\r
-partner = Wscript.Arguments.Named("partnerSdk")\r
-set oShellLink = WshShell.CreateShortcut(linkFilePath)\r
-oShellLink.TargetPath = filename\r
-oShellLink.IconLocation = Wscript.Arguments.Named("icon")\r
-oShellLink.WorkingDirectory = filesys.GetParentFolderName(filename)\r
-oShellLink.WindowStyle = 1\r
-oShellLink.Save\r
diff --git a/SdkImageCreator/src/res/desktop_directory/remove.sh b/SdkImageCreator/src/res/desktop_directory/remove.sh
deleted file mode 100644 (file)
index 78429f7..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/bin/bash -x
-
-##remove installmanager shortcut
-INSTALLMANAGER_DESKTOP_FILE_PATH=${HOME}/.local/share/applications/tizen-sdk-installmanager.desktop
-${REMOVE_SHORTCUT} ${INSTALLMANAGER_DESKTOP_FILE_PATH}
-
-##remove menu directory
-MENU_DIRECTORY_PATH=${HOME}/.local/share/desktop-directories/tizen-sdk-menu.directory
-rm ${MENU_DIRECTORY_PATH}
-
-##remove icon file
-IM_ICON_FILE_PATH=${INSTALLED_PATH}/InstallManager/tizen-sdk-installmanager.png
-MENU_ICON_FILE_PATH=${INSTALLED_PATH}/InstallManager/tizen-sdk-menu.png
-
-rm -f ${IM_ICON_FILE_PATH}
-rm -f ${MENU_ICON_FILE_PATH}
-
-##remove old icon file
-IM_ICON_FILE_PATH_OLD=${HOME}/.local/share/icons/tizen-sdk-installmanager.png
-MENU_ICON_FILE_PATH_OLD=${HOME}/.local/share/icons/tizen-sdk-menu.png 
-
-rm -f ${IM_ICON_FILE_PATH_OLD}
-rm -f ${MENU_ICON_FILE_PATH_OLD}
diff --git a/SdkImageCreator/src/res/desktop_directory/remove.vbs b/SdkImageCreator/src/res/desktop_directory/remove.vbs
deleted file mode 100644 (file)
index 42d65b3..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-Set wshShell = Wscript.CreateObject("Wscript.Shell")\r
-programsPath = wshShell.SpecialFolders("Programs")\r
-TizenSDKPath = programsPath & "\Tizen SDK"\r
-\r
-Set WshEnv = wshShell.Environment("Process")\r
-installedPath = WshEnv("INSTALLED_PATH")\r
-\r
-Set fso = CreateObject("Scripting.FileSystemObject")\r
-\r
-''Remove shortcut menu\r
-if fso.FolderExists(TizenSDKPath) then\r
-       fso.DeleteFolder(TizenSDKPath)\r
-end if\r
-\r
-''Remove icon file\r
-IM_ICON_FILE_PATH = installedPath & "\InstallManager\tizen-sdk-installmanager.ico"\r
-MENU_ICON_FILE_PATH = installedPath & "\InstallManager\tizen-sdk-menu.ico"\r
-\r
-if fso.FileExists(IM_ICON_FILE_PATH) then\r
-       Set aFile = fso.GetFile(IM_ICON_FILE_PATH)\r
-       aFile.Delete\r
-end if\r
-\r
-if fso.FileExists(MENU_ICON_FILE_PATH) then\r
-       Set aFile = fso.GetFile(MENU_ICON_FILE_PATH)\r
-       aFile.Delete\r
-end if
\ No newline at end of file
diff --git a/SdkImageCreator/src/res/desktop_directory/removeOldSDK.sh b/SdkImageCreator/src/res/desktop_directory/removeOldSDK.sh
deleted file mode 100644 (file)
index a8b101a..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/bin/sh -x
-
-echo Remove old sdk
-
-if [ "x$INSTALLED_PATH" != "x" ]
-then
-       if [ -e $INSTALLED_PATH ]
-       then
-               rm -rf $INSTALLED_PATH
-       else
-               echo installed path does not exists: $INSTALLED_PATH
-       fi
-       
-else
-       echo installed path not provided
-fi
-
-# remove old Tizen SDK
-rm -rf $HOME/.slpsdk
-rm -rf $HOME/.local/share/applications/samsung-sdk-*
-rm -rf $HOME/.local/share/applications/wac-ide.desktop
-rm -rf $HOME/.local/share/desktop-directories/samsung-sdk_menu.directory
-rm -rf $HOME/.config/menus/applications-merged/user-samsung-sdk_menu.menu
-
-# remove tizen sdk
-rm -rf $HOME/.tizensdk
-rm -rf $HOME/.local/share/applications/tizen-sdk-*
-rm -rf $HOME/.local/share/desktop-directories/tizen-sdk-menu.directory
-rm -rf $HOME/.config/menus/applications-merged/user-tizen-sdk-menu.menu
-
-exit 0
-
-
-
diff --git a/SdkImageCreator/src/res/desktop_directory/removeOldSDK.vbs b/SdkImageCreator/src/res/desktop_directory/removeOldSDK.vbs
deleted file mode 100644 (file)
index 0e33703..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-Set wshShell = Wscript.CreateObject("Wscript.Shell")
-
-Set WshEnv = wshShell.Environment("Process")
-installedPath = WshEnv("INSTALLED_PATH")
-
-Set fso = CreateObject("Scripting.FileSystemObject")
-
-''Remove target directory
-if fso.FolderExists(installedPath) then
-       fso.DeleteFolder(installedPath)
-end if
-
-''Remove shortcut menu
-programsPath = wshShell.SpecialFolders("Programs")
-
-oldSamsungShortcutPath = programsPath & "\Samsung Linux Platform"
-if fso.FolderExists(oldSamsungShortcutPath) then
-       fso.DeleteFolder(oldSamsungShortcutPath)
-end if
-
-oldTizenShortcutPath = programsPath & "\Tizen SDK"
-if fso.FolderExists(oldTizenShortcutPath) then
-       fso.DeleteFolder(oldTizenShortcutPath)
-end if
\ No newline at end of file
diff --git a/SdkImageCreator/src/res/desktop_directory/removeshortcut.sh b/SdkImageCreator/src/res/desktop_directory/removeshortcut.sh
deleted file mode 100755 (executable)
index 48dcf11..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/bash -x
-
-MENU_DIRECTORY_NAME=tizen-sdk-menu.directory
-
-xdg-desktop-menu uninstall ${MENU_DIRECTORY_NAME} $@
-
diff --git a/SdkImageCreator/src/res/desktop_directory/removeshortcut.vbs b/SdkImageCreator/src/res/desktop_directory/removeshortcut.vbs
deleted file mode 100644 (file)
index af8e933..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-Set wshShell = Wscript.CreateObject("Wscript.Shell")\r
-programsPath = wshShell.SpecialFolders("Programs")\r
-TizenSDKPath = programsPath & "\Tizen SDK"\r
-linkFilePath = TizenSDKPath & "\" & Wscript.Arguments.Named("shortcut") & ".lnk"\r
-\r
-Set fso = CreateObject("Scripting.FileSystemObject")\r
-if fso.FileExists(linkFilePath) then\r
-       Set aFile = fso.GetFile(linkFilePath)\r
-       aFile.Delete\r
-end if\r
diff --git a/SdkImageCreator/src/res/desktop_directory/tizen-sdk-installmanager.ico b/SdkImageCreator/src/res/desktop_directory/tizen-sdk-installmanager.ico
deleted file mode 100644 (file)
index e622ccf..0000000
Binary files a/SdkImageCreator/src/res/desktop_directory/tizen-sdk-installmanager.ico and /dev/null differ
diff --git a/SdkImageCreator/src/res/desktop_directory/tizen-sdk-installmanager.png b/SdkImageCreator/src/res/desktop_directory/tizen-sdk-installmanager.png
deleted file mode 100644 (file)
index f4d6c82..0000000
Binary files a/SdkImageCreator/src/res/desktop_directory/tizen-sdk-installmanager.png and /dev/null differ
diff --git a/SdkImageCreator/src/res/desktop_directory/tizen-sdk-menu.directory b/SdkImageCreator/src/res/desktop_directory/tizen-sdk-menu.directory
deleted file mode 100644 (file)
index ff01f60..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-[Desktop Entry]                
-Type=Directory
-Version=1.0
-Name=Tizen SDK
-Comment=Tizen SDK
-Icon=$$ICON_PATH$$
\ No newline at end of file
diff --git a/SdkImageCreator/src/res/desktop_directory/tizen-sdk-menu.ico b/SdkImageCreator/src/res/desktop_directory/tizen-sdk-menu.ico
deleted file mode 100644 (file)
index 6241105..0000000
Binary files a/SdkImageCreator/src/res/desktop_directory/tizen-sdk-menu.ico and /dev/null differ
diff --git a/SdkImageCreator/src/res/desktop_directory/tizen-sdk-menu.png b/SdkImageCreator/src/res/desktop_directory/tizen-sdk-menu.png
deleted file mode 100755 (executable)
index 728efe0..0000000
Binary files a/SdkImageCreator/src/res/desktop_directory/tizen-sdk-menu.png and /dev/null differ
diff --git a/SdkImageCreator/src/res/icons/SDK_icon.png b/SdkImageCreator/src/res/icons/SDK_icon.png
deleted file mode 100644 (file)
index ed832c6..0000000
Binary files a/SdkImageCreator/src/res/icons/SDK_icon.png and /dev/null differ
diff --git a/SdkImageCreator/src/res/icons/icon_directory_open.png b/SdkImageCreator/src/res/icons/icon_directory_open.png
deleted file mode 100644 (file)
index 5ba5abd..0000000
Binary files a/SdkImageCreator/src/res/icons/icon_directory_open.png and /dev/null differ
diff --git a/SdkImageCreator/src/res/icons/icon_error.png b/SdkImageCreator/src/res/icons/icon_error.png
deleted file mode 100644 (file)
index bc6bf09..0000000
Binary files a/SdkImageCreator/src/res/icons/icon_error.png and /dev/null differ
diff --git a/SdkImageCreator/src/res/icons/icon_loading.png b/SdkImageCreator/src/res/icons/icon_loading.png
deleted file mode 100644 (file)
index d3d1a0c..0000000
Binary files a/SdkImageCreator/src/res/icons/icon_loading.png and /dev/null differ
diff --git a/SdkImageCreator/src/res/icons/icon_login.png b/SdkImageCreator/src/res/icons/icon_login.png
deleted file mode 100644 (file)
index 0c1f057..0000000
Binary files a/SdkImageCreator/src/res/icons/icon_login.png and /dev/null differ
diff --git a/SdkImageCreator/src/res/icons/icon_messages.png b/SdkImageCreator/src/res/icons/icon_messages.png
deleted file mode 100644 (file)
index 7a4848e..0000000
Binary files a/SdkImageCreator/src/res/icons/icon_messages.png and /dev/null differ
diff --git a/SdkImageCreator/src/res/icons/icon_notify.png b/SdkImageCreator/src/res/icons/icon_notify.png
deleted file mode 100644 (file)
index d286dd0..0000000
Binary files a/SdkImageCreator/src/res/icons/icon_notify.png and /dev/null differ
diff --git a/SdkImageCreator/src/res/icons/icon_permission.png b/SdkImageCreator/src/res/icons/icon_permission.png
deleted file mode 100644 (file)
index f7ffe9d..0000000
Binary files a/SdkImageCreator/src/res/icons/icon_permission.png and /dev/null differ
diff --git a/SdkImageCreator/src/res/icons/icon_repositories.png b/SdkImageCreator/src/res/icons/icon_repositories.png
deleted file mode 100644 (file)
index c3353f8..0000000
Binary files a/SdkImageCreator/src/res/icons/icon_repositories.png and /dev/null differ
diff --git a/SdkImageCreator/src/res/icons/icon_warning.png b/SdkImageCreator/src/res/icons/icon_warning.png
deleted file mode 100644 (file)
index 8ff148c..0000000
Binary files a/SdkImageCreator/src/res/icons/icon_warning.png and /dev/null differ
diff --git a/SdkImageCreator/src/res/images/install_manager_graphicmotif_001.png b/SdkImageCreator/src/res/images/install_manager_graphicmotif_001.png
deleted file mode 100644 (file)
index 7628099..0000000
Binary files a/SdkImageCreator/src/res/images/install_manager_graphicmotif_001.png and /dev/null differ
diff --git a/SdkImageCreator/src/res/images/install_manager_graphicmotif_002.png b/SdkImageCreator/src/res/images/install_manager_graphicmotif_002.png
deleted file mode 100644 (file)
index 3cea32d..0000000
Binary files a/SdkImageCreator/src/res/images/install_manager_graphicmotif_002.png and /dev/null differ
diff --git a/SdkImageCreator/src/res/images/install_manager_graphicmotif_003.png b/SdkImageCreator/src/res/images/install_manager_graphicmotif_003.png
deleted file mode 100644 (file)
index e84c825..0000000
Binary files a/SdkImageCreator/src/res/images/install_manager_graphicmotif_003.png and /dev/null differ
diff --git a/SdkImageCreator/src/res/images/install_manager_graphicmotif_004.png b/SdkImageCreator/src/res/images/install_manager_graphicmotif_004.png
deleted file mode 100644 (file)
index 021c39a..0000000
Binary files a/SdkImageCreator/src/res/images/install_manager_graphicmotif_004.png and /dev/null differ
diff --git a/SdkImageCreator/src/res/images/install_manager_graphicmotif_welcome.png b/SdkImageCreator/src/res/images/install_manager_graphicmotif_welcome.png
deleted file mode 100644 (file)
index ce75786..0000000
Binary files a/SdkImageCreator/src/res/images/install_manager_graphicmotif_welcome.png and /dev/null differ
diff --git a/SdkImageCreator/src/res/images/uninstaller_graphicmotif_001.png b/SdkImageCreator/src/res/images/uninstaller_graphicmotif_001.png
deleted file mode 100644 (file)
index a01e831..0000000
Binary files a/SdkImageCreator/src/res/images/uninstaller_graphicmotif_001.png and /dev/null differ
diff --git a/SdkImageCreator/src/res/images/uninstaller_graphicmotif_002.png b/SdkImageCreator/src/res/images/uninstaller_graphicmotif_002.png
deleted file mode 100644 (file)
index f6aa70e..0000000
Binary files a/SdkImageCreator/src/res/images/uninstaller_graphicmotif_002.png and /dev/null differ
diff --git a/SdkImageCreator/src/res/images/uninstaller_graphicmotif_003.png b/SdkImageCreator/src/res/images/uninstaller_graphicmotif_003.png
deleted file mode 100644 (file)
index 38195f0..0000000
Binary files a/SdkImageCreator/src/res/images/uninstaller_graphicmotif_003.png and /dev/null differ
diff --git a/SdkImageCreator/src/res/installmanager/buildversion b/SdkImageCreator/src/res/installmanager/buildversion
deleted file mode 100644 (file)
index 426afb2..0000000
+++ /dev/null
@@ -1 +0,0 @@
-This file will be replaced with the build version when being built by ant
\ No newline at end of file
diff --git a/SdkImageCreator/src/res/installmanager/removetizentemp.bat b/SdkImageCreator/src/res/installmanager/removetizentemp.bat
deleted file mode 100644 (file)
index 8b32044..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-set start_time=%time%\r
-set start_min=%start_time:~3,2%\r
-set start_sec=%start_time:~6,2%\r
-\r
-set /a expire=%start_min%+1\r
-set expire=%expire%%start_sec%\r
-\r
-:deleteTargetDir\r
-\r
-set now_time=%time%\r
-set now_min=%now_time:~3,2%\r
-set now_sec=%now_time:~6,2%\r
-\r
-rem if min changed from 59 to 0, add 60\r
-if %now_min% LSS %start_min% set /a now_min=%now_min%+60\r
-\r
-rem expire after 1minutes\r
-if %expire% LSS %now_min%%now_sec% goto endScript\r
-\r
-rd /s/q %TARGET_DIR%\r
-\r
-if exist %TARGET_DIR% goto deleteTargetDir\r
-\r
-:endScript\r
-del %REMOVE_SCRIPT_PATH%
\ No newline at end of file
diff --git a/UpdateInstallManager/.project b/UpdateInstallManager/.project
deleted file mode 100644 (file)
index 3bc2eb0..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-       <name>InstallManagerUpdater</name>
-       <comment></comment>
-       <projects>
-       </projects>
-       <buildSpec>
-               <buildCommand>
-                       <name>org.eclipse.jdt.core.javabuilder</name>
-                       <arguments>
-                       </arguments>
-               </buildCommand>
-       </buildSpec>
-       <natures>
-               <nature>org.eclipse.jdt.core.javanature</nature>
-       </natures>
-</projectDescription>
diff --git a/UpdateInstallManager/.settings/org.eclipse.jdt.core.prefs b/UpdateInstallManager/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644 (file)
index b6a010f..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-#Fri Nov 11 13:51:11 KST 2011
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.6
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.6
diff --git a/UpdateInstallManager/src/org/tizen/installmanager/updater/InstallManagerUpdater.java b/UpdateInstallManager/src/org/tizen/installmanager/updater/InstallManagerUpdater.java
deleted file mode 100644 (file)
index 92d0375..0000000
+++ /dev/null
@@ -1,183 +0,0 @@
-/*
-*  InstallManager
-*
-* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
-*
-* Contact: 
-* Wooyoung Cho <wooyoung1.cho@samsung.com>
-* Shihyun Kim <shihyun.kim@samsung.com>
-* Taeyoung Son <taeyoung2.son@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.updater;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.PrintWriter;
-
-public class InstallManagerUpdater {
-       //old version configuration directory
-       private final String OLD_CONFIGURATION_DIRECTORY_NAME = ".TizenSDK";
-       private final String OLD_CONFIGURATION_DIRECTORY_PATH = 
-                       System.getProperty("user.home") + File.separator + OLD_CONFIGURATION_DIRECTORY_NAME;
-       private final String SDK_PATH_FILE_NAME = "tizensdkpath";
-       private final String OLD_SDK_PATH_FILE = OLD_CONFIGURATION_DIRECTORY_PATH + File.separator + SDK_PATH_FILE_NAME;
-       
-       //current configuration directory
-       private final String CONFIGURATION_DIRECTORY_NAME= "tizen-sdk-data";
-       private final String CONFIGURATION_DIRECTORY_PATH = 
-                       System.getProperty("user.home") + File.separator + CONFIGURATION_DIRECTORY_NAME;
-       
-       private static PrintWriter writer;
-       
-       private static void initWriter() {
-               try {
-                       writer = new PrintWriter(new File(System.getProperty("user.dir") + 
-                                       File.separator +"updater.log"));
-               } catch (FileNotFoundException e) {
-                       e.printStackTrace();
-               }
-       }
-       
-       public boolean moveFile(String from, String to) {
-               return moveFile(new File(from), new File(to));
-       }
-       
-       public boolean moveFile(File from, File to) {
-               writer.println("Move " + from + " to " + to);
-               if (!from.exists()) {
-                       writer.println("File not found: "+from);
-                       return false;
-               } else {} //nothing
-               
-               if (to.exists()) {
-                       writer.println("File exists. try to delete : "+to);
-                       if(to.delete()) {
-                               writer.println("deleted");
-                       } else {
-                               writer.println("delete fail");
-                               return false;
-                       }
-               } else {}
-               
-               return from.renameTo(to);
-       }
-       
-       /**
-        * Moves new IM to old IM and run the IM.
-        * @param args args[0] is path of new IM. args[1] is path of old IM.
-        */
-       public static void main(String[] args) {
-               initWriter();
-               
-               if (args.length < 2) {
-                       return;
-               }
-               
-               try {
-                       writer.println("sleep 3000");
-                       Thread.sleep(3000);
-               } catch (InterruptedException e) {
-                       // TODO Auto-generated catch block
-                       e.printStackTrace();
-               }
-               
-               String[] imargs = new String[args.length-2];
-               for(int i = 0; i < args.length-2; i++) {
-                       imargs[i] = args[i+2];
-               }
-               
-               InstallManagerUpdater upInstallManager = new InstallManagerUpdater();
-               
-               if (upInstallManager.checkUpdatable()) {
-                       upInstallManager.update(args[0], args[1], imargs, true);
-               } else {
-                       writer.println("Installed installmanager is not updatable version.");
-                       upInstallManager.convert(args[1]);
-                       upInstallManager.update(args[0], args[1], imargs, false);
-               }
-               
-               writer.close();
-       }
-       
-       private void update(String newIM, String oldIM, String[] imargs, boolean isUpdatable) {
-               boolean bResult = moveFile(newIM, oldIM);
-               String imarg = "";
-               for(String a : imargs) {
-                       imarg = imarg + " " + a;
-               }
-               
-               if (bResult) {
-                       try {
-                               File toFile = new File(oldIM);
-                               toFile.setExecutable(true);
-                               writer.println("run IM");
-                               
-                               if (isUpdatable) {
-                                       Runtime.getRuntime().exec("java -jar " + toFile.getAbsolutePath() + " -updated " + imarg);
-                               } else {
-                                       Runtime.getRuntime().exec("java -jar " + toFile.getAbsolutePath() + " -removeOldSDK");
-                               }
-                       } catch (IOException e) {
-                               writer.println("run failed");
-                       }
-               } else {
-                       writer.println("move failed");
-               }
-       }
-       
-       /**
-        * Check that installmanager is updatable.
-        * @return if <code>true</code>, installmanager can update.
-        */
-       public boolean checkUpdatable() {
-               //temporary code to update
-               File oldSDKPathFile = new File(OLD_SDK_PATH_FILE);
-               
-               if (oldSDKPathFile.exists()) {
-                       return false;
-               } else {
-                       return true;
-               }
-       }
-       
-       private boolean makeNewConfigDir() {
-               File oldConfigHome = new File(OLD_CONFIGURATION_DIRECTORY_PATH);
-               File currentConfigHome = new File(CONFIGURATION_DIRECTORY_PATH);
-               
-               try {
-                       return PathUtil.copy(oldConfigHome, currentConfigHome);
-               } catch (IOException e) {
-                       return false;
-               }
-       }
-       
-       /**
-        * Temporary function to update.
-        * @param executableFile
-        */
-       private void convert(String executableFile) {
-               if (!makeNewConfigDir()) {
-                       writer.println("Make new config direcotry is fail.");
-               }
-       }
-
-}
diff --git a/UpdateInstallManager/src/org/tizen/installmanager/updater/PathUtil.java b/UpdateInstallManager/src/org/tizen/installmanager/updater/PathUtil.java
deleted file mode 100644 (file)
index f14b216..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-package org.tizen.installmanager.updater;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-
-
-public class PathUtil {
-       private final static int BUF_SIZE = 65536;
-       /**
-        * copy file or directory.
-        * @param from source file
-        * @param to destination file
-        * @return
-        * @throws IOException
-        */
-       public static boolean copy(File fromFile, File toFile) throws IOException {
-               if (!fromFile.exists()) {
-                       return false;
-               }
-               
-               if (!fromFile.isDirectory()) {
-                       if (toFile.exists()) {
-                               toFile.delete();
-                       }
-                       
-                       return copyFile(fromFile, toFile);
-               } else {
-                       if (!toFile.exists()) {
-                               toFile.mkdirs();
-                       }
-               }
-               
-               File[] fileList = fromFile.listFiles();
-               if (fileList == null || fileList.length == 0) {
-                       return true;
-               }
-               
-               for (int i=0; i<fileList.length; i++) {
-                       copy(fileList[i], new File(toFile.getAbsolutePath() + File.separator + fileList[i].getName()));
-               }
-               return true;
-       }
-       
-       /**
-        * copy file.
-        * @param from source file
-        * @param to destination file
-        * @return
-        * @throws IOException
-        */
-       private static boolean copyFile(File from, File to) throws IOException {
-               if (!from.exists()) {
-                       return false;
-               }
-               
-               if (!to.exists()) {
-                       to.createNewFile();
-               }
-               
-               FileInputStream fInput = null;
-               FileOutputStream fOutput = null;
-               try {
-                       fInput = new FileInputStream(from);
-                       fOutput = new FileOutputStream(to);
-                       
-                       int readSize = 0;
-                       byte[] buf = new byte[BUF_SIZE];
-                       while((readSize = fInput.read(buf, 0, BUF_SIZE)) != -1) {
-                               fOutput.write(buf, 0, readSize);
-                       }
-                       
-                       return true;
-               } catch (FileNotFoundException e) {
-                       return false;
-               } catch (IOException e) {
-                       return false;
-               } finally {
-                       try {
-                               if (fInput != null) {
-                                       fInput.close();
-                               }
-                               if (fOutput != null) {
-                                       fOutput.close();
-                               }
-                       } catch (IOException e) {
-                               return false;
-                       }
-               }
-       }
-}
diff --git a/unittest/.project b/unittest/.project
deleted file mode 100644 (file)
index d57b04a..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-       <name>unittest</name>
-       <comment></comment>
-       <projects>
-       </projects>
-       <buildSpec>
-               <buildCommand>
-                       <name>org.eclipse.jdt.core.javabuilder</name>
-                       <arguments>
-                       </arguments>
-               </buildCommand>
-       </buildSpec>
-       <natures>
-               <nature>org.eclipse.jdt.core.javanature</nature>
-       </natures>
-</projectDescription>
diff --git a/unittest/.settings/org.eclipse.jdt.core.prefs b/unittest/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644 (file)
index da5a3ba..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-#Wed Nov 30 17:51:35 KST 2011
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.6
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.6
diff --git a/unittest/src/com/samsung/installmanager/tests/InstallManagerTest.java b/unittest/src/com/samsung/installmanager/tests/InstallManagerTest.java
deleted file mode 100644 (file)
index 6e9c126..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-package com.samsung.installmanager.tests;
-
-import static org.junit.Assert.*;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.List;
-import org.junit.Test;
-
-import com.samsung.installmanager.pkg.lib.PackageManager2;
-import com.samsung.installmanager.pkg.lib.PropertyParser;
-import com.samsung.installmanager.pkg.model.Package2;
-import com.samsung.installmanager.pkg.model.PackageSet;
-import com.samsung.installmanager.pkg.model.PropertySection;
-import com.samsung.installmanager.util.PathUtil;
-
-public class InstallManagerTest {
-
-       private List<PropertySection> parse(String resource) {
-               File file;
-               try {
-                       file = PathUtil.getTempFileFromResource(resource, "test", ".list");
-                       PropertyParser parser = new PropertyParser();
-               List<PropertySection> propertySections = parser.readFromFile(file);
-               return propertySections;
-               } catch (IOException e) {
-                       fail();
-               }
-               return null;
-       }
-       
-       @Test
-       public void testPackageManager() {
-               List<PropertySection> installed = parse("/com/samsung/installmanager/tests/installedpackage.list");
-               List<PropertySection> repo = parse("/com/samsung/installmanager/tests/Packages_repo.list");
-               HashMap<String,List<PropertySection>> repoMap = new HashMap<String,List<PropertySection>>();
-               repoMap.put("http://some.where/", repo);
-        PackageManager2 pm = new PackageManager2(installed, repoMap);
-        PackageSet recent = pm.getRecentPackages();
-        //check depends
-        for(Package2 p : recent) {
-               pm.dep(p);
-        }
-        //check conflicts
-        for(Package2 p : recent) {
-               pm.conflict(p);
-        }
-        System.out.println(recent);
-        System.out.println(pm.getUpdatableInstalledPackages());
-        System.out.println(pm.getInstalledMetaPackages());
-        System.out.println(pm.getAllMetaPackages());
-        System.out.println(pm.getNotUpdatableMetaPackages());
-        System.out.println(pm.getUpdatableMetaPackages());
-        LinkedList<String> Msel = new LinkedList<String>();
-        Msel.add("EMULATOR");
-        System.out.println(pm.getResultPackagesAfterUpdate(pm.getPackagesByNames(Msel)));
-       }
-
-}
diff --git a/unittest/src/com/samsung/installmanager/tests/Packages_repo.list b/unittest/src/com/samsung/installmanager/tests/Packages_repo.list
deleted file mode 100644 (file)
index e71209b..0000000
+++ /dev/null
@@ -1,319 +0,0 @@
-Package : toolchain-gcc-4.5.3
-Version : 0.16.6
-Maintainer : ha taejun <taejun.ha>
-Description : gnu tool chain for SLP SDK
-Depends : slp-base-toolchain, i386-linux-gnueabi-gcc-4.5.3, i386-linux-gnueabi-gdb-7.2, arm-linux-gnueabi-gcc-4.5.3, arm-linux-gnueabi-gdb-7.2
-Category : SDK/build-system/toolchains
-Size: 5068
-Path: /toolchain-gcc-4.5.3_0.16.6_windows.zip
-SHA256: bd77070bb6f2ba35d27929084cc4738c04bd07a89a9ad2826812a22e947fd9aa
-
-Package : GUIBuilder
-Version : 0.3.6
-Maintainer : Changhun Lim <changhun.lim@samsung.com>, Hyunjun Son <hj79.son@samsung.com>
-Description : GUIBuilder
-Category : GUIBuilder
-Depends :
-Install-script : install.sh
-Remove-script : remove.sh
-Size: 7662078
-Path: /GUIBuilder_0.3.6_windows.zip
-SHA256: 63b2264b369f27d4c9d6e553587a67d921b151e87a3ed9cdde2917e6d658dcc0
-
-Package:slp-ide
-Version:1.16.245
-Maintainer:hoon Kang <h245.kang@samsung.com>, taeyoung Son, sihyun Kim
-Description:Samsung Liux Platform IDE
-Category:IDE/SLP IDE/Workbench
-Install-script:install.bat
-Remove-script:remove.bat
-Size: 112081040
-Path: /slp-ide_1.16.245_windows.zip
-SHA256: 93512e98eab1fdbfdf57a86964b201d68a54a57816e131b94db56d5d4e394237
-
-Package : arm-linux-gnueabi-gdb-7.2
-Version : 0.10.0
-Maintainer : ha taejun <taejun.ha>
-Description : gnu debug tool 7.2 for SLP SDK
-Depends :
-Category : SDK/build-system/toolchains
-Size: 10639372
-Path: /arm-linux-gnueabi-gdb-7.2_0.10.0_windows.zip
-SHA256: f797baa924170c6dd66aa0cf52d56313e65749998c8ea61de22a79ce06482e64
-
-Package : smart-build-interface
-Version : 0.13.0
-Maintainer : taejun ha<taejun.ha>
-Description : smart build interface for SLP SDK
-Depends : 
-Category : SDK/build-system/base
-Size: 1688171
-Path: /smart-build-interface_0.13.0_windows.zip
-SHA256: 093808411cdd0cb8dccac4bbfc84ada7392c4630052df0b4b50f856ac014a539
-
-Package: slp-emulator-image
-Version: 1.1.91
-Maintainer: Yeong-Kyoon, Lee <yeongkyoon.lee@samsung.com> Dong-Kyun, Yun <dk77.yun@samsung.com>
-Description: Samsung Linux Platform Emulator Image
-Remove-script: remove.bat
-Category: SDK/Emulator
-Size: 221298348
-Path: /emulator-image_1.1.91_windows.zip
-SHA256: f3a480a88ec2ce628d7530e11bfa6697d719fe521ad99874c4c2ad5f43b15387
-
-Package : rootstrap-slp-emulator-1.0
-Version : 0.14.162
-Maintainer : hyoun jiil <jiil.hyoun@samsung.com>
-Description : i386 rootstrap for SLP SDK
-Depends :
-Category : SDK/build-system/rootstraps
-Size: 160261762
-Path: /rootstrap-slp-emulator-1.0_0.14.162_windows.zip
-SHA256: 1acea77cc051ef3d7e1439396979a11ea3d614d054bf0e24e014b378788f28eb
-
-Package : arm-linux-gnueabi-gcc-4.5.3
-Version : 0.10.0
-Maintainer : ha taejun <taejun.ha>
-Description : gnu compiler 4.5.3 for SLP SDK
-Depends : 
-Category : SDK/build-system/toolchains
-Size: 114253719
-Path: /arm-linux-gnueabi-gcc-4.5.3_0.10.0_windows.zip
-SHA256: 0f48917ba380137de02415dcece5b816f6ed77f1fe8f8a6153591a7db7d871ce
-
-Package : slp-base-toolchain
-Version : 0.16.2
-Maintainer : ha taejun <taejun.ha>
-Description : base tool chain for SLP SDK
-Depends :
-Install-script:install.bat
-Category : SDK/build-system/toolchains
-Size: 289526856
-Path: /base-toolchain_0.16.2_windows.zip
-SHA256: befcef30c59b6c046c7c8318652140474401b98e0e31a0b43c15723236d4b929
-
-Package : NATIVE_IDE
-Version : 0.16.71
-Maintainer : JongHwan Park <jonghwan2.park@samsung.com>
-Depends : CodeCoverage, rootstrap-slp-device-1.0, arm-linux-gnueabi-gdb-7.2, Profiler, smart-build-interface, UnitTest, arm-linux-gnueabi-gcc-4.5.3, i386-linux-gnueabi-gcc-4.5.3, info, toolchain-gcc-4.5.3, EventInjector, rootstrap-slp-emulator-1.0, slp-base-toolchain, document, i386-linux-gnueabi-gdb-7.2, slp-ide, sdb, GUIBuilder, GUIBuilderPlugins, Efl
-Description : Install NATIVE IDE.
-Attribute : root
-Category : /
-Size: 633
-Path: /NATIVE_IDE_0.16.71_windows.zip
-SHA256: 226a848d5865d40b1175aaee4445e33b0c24b779ae0d390d8cf27af984f61586
-
-Package : i386-linux-gnueabi-gcc-4.5.3
-Version : 0.10.0
-Maintainer : ha taejun <taejun.ha>
-Description : gnu compiler 4.5.3 for SLP SDK
-Depends : 
-Category : SDK/build-system/toolchains
-Size: 120422681
-Path: /i386-linux-gnueabi-gcc-4.5.3_0.10.0_windows.zip
-SHA256: ba9601d18a228e83ae8df97adc1007176f65326cbe7dcc40fd4de11312270830
-
-Package : Efl
-Version : 0.3.35
-Maintainer : Changhun Lim <changhun.lim@samsung.com>
-Description : Efl
-Category : Efl
-Depends :
-Size: 46924949
-Path: /Efl_0.3.35_windows.zip
-SHA256: 8e55b402087e192d32942fdab21c91c2e020dfb74f714821ff03b08981b6f739
-
-Package : rootstrap-slp-device-1.0
-Version : 0.14.162
-Maintainer : hyoun jiil <jiil.hyoun@samsung.com>
-Description : arm rootstrap for SLP SDK
-Depends :
-Category : SDK/build-system/rootstraps
-Size: 209315907
-Path: /rootstrap-slp-device-1.0_0.14.162_windows.zip
-SHA256: ff800d4b70153f110383e6842ea9b44fb9e9562e25878342701c549dcf7b077e
-
-Package:sdb
-Version:0.1.35
-Maintainer:Hoon Kang <h245.kang@samsung.com>, Joogwan Kim
-Description:Smart Development Bridge for device management
-Remove-script:remove.bat
-Size: 146872
-Path: /sdb_0.1.35_windows.zip
-SHA256: 1dffb8554c1a15682313dec96039bc1f3eb2177ed276ec1f15061583987217f4
-
-Package : EMULATOR
-Version : 0.16.71
-Maintainer : JongHwan Park <jonghwan2.park@samsung.com>
-Depends :  slp-emulator, slp-emulator-image
-Description : Install EMULATOR.
-Attribute : root
-Category : /
-Size: 476
-Path: /EMULATOR_0.16.71_windows.zip
-SHA256: 598e026e437b75837a68f96d5b69d9bada060387ed96a7fc937a70fc5c972d64
-
-Package: slp-emulator
-Version: 1.1.221
-Maintainer: Yeong-Kyoon, Lee <yeongkyoon.lee@samsung.com> Dong-Kyun, Yun <dk77.yun@samsung.com>
-Description: Samsung Linux Platform Emulator
-Install-script: install.bat
-Remove-script: remove.bat
-Category: SDK/Emulator
-Size: 27050568
-Path: /emulator_1.1.221_windows.zip
-SHA256: b35a229ca04ab7b96b733939388dbe2f0a2b4ffc3f63cf4c20f890f7a88a5831
-
-Package : info
-Version : 1.0.224
-Maintainer : JongHwan Park<jonghwan2.park@samsung.com>
-Description : information document for sdk-slp
-Category : SDK
-Size: 42649
-Path: /info_1.0.224_windows.zip
-SHA256: f5c91a5a05f59b0dd03e1a3cfb3022b48ca4146295b09e8b43947b595ee69a32
-
-Package:EventInjector
-Version:1.1
-Architecture:i386
-Maintainer:juyung Kim <j0.kim@samsung.com>, jaewon lim <jaewon81.lim@samsung.com>, sungmin Ha <sungmin82.ha@samsung.com>
-Description:EventInjector for emulator
-Install-script:
-Remove-script:
-Category:IDE/SLP IDE/Plugins/EventInjector
-Depends:
-Size: 223135
-Path: /eventinjector_1.1.254_windows.zip
-SHA256: 991e094481ce3ef285c0e0a88c3ac0ae882ce778efb2191d9b7c722d39413d92
-
-Package : WAC_IDE
-Version : 0.16.71
-Maintainer : JongHwan Park <jonghwan2.park@samsung.com>
-Depends : wac-ide, EventInjector_Wac, info, sdb
-Description : Install WAC IDE.
-Attribute : root
-Category : /
-Size: 487
-Path: /WAC_IDE_0.16.71_windows.zip
-SHA256: 62f972aef511cf72145823ad8d44b86e7ec5c7490056159ba18e0e72e28b947b
-
-Package:EventInjector_Wac
-Version:1.1
-Architecture:i386
-Maintainer:juyung Kim <j0.kim@samsung.com>, jaewon lim <jaewon81.lim@samsung.com>, sungmin Ha <sungmin82.ha@samsung.com>
-Description:EventInjector for emulator
-Install-script:
-Remove-script:
-Category:IDE/WAC IDE/Plugins/EventInjector
-Size: 223133
-Path: /eventinjector_wac_1.1.254_windows.zip
-SHA256: 60ff7fa5da778f4997a361a500dc7488c883e7dc529dd559a91efd9674a97499
-
-Package : wac-ide
-Version : 1.16.221
-Maintainer : kangho kim <kh5325.kim@samsung.com> jihoon song<jihoon80.song@samsung.com>
-Description : Samsung Linux Platform WAC IDE
-Category : IDE/WAC IDE/Workbench
-Install-script : install.bat
-Remove-script : remove.bat
-Size: 181060397
-Path: /wac-ide_0.16.221_windows.zip
-SHA256: 3d4169b08a067bb0ffa582a2f96b05e3784249d6a3de4f0ba278952da33ffcec
-
-Package: document
-Version: 1.2.147
-Architecture: i386
-Maintainer: Shingil Kang <shingil.kang@samsung.com>
-Description: Samsung API Document. Provides API document for Samsung SDK developers.
-Category: SDK/Documents
-Size: 27098678
-Path: /document_1.2.147_windows.zip
-SHA256: a2936d618bf6f92e4c68f566c7817920575bb416fec35db3f8f39ec3b1d58001
-
-Package : i386-linux-gnueabi-gdb-7.2
-Version : 0.10.0
-Maintainer : ha taejun <taejun.ha>
-Description : gnu debugger 7.2 for SLP SDK
-Depends :
-Category : SDK/build-system/toolchains
-Size: 8984057
-Path: /i386-linux-gnueabi-gdb-7.2_0.10.0_windows.zip
-SHA256: e6a836794e7697e5d4bf16591b3b08e1b6b434ac9100fd0303538224a63ab260
-
-Package:UnitTest 
-Version:1.16.246
-Maintainer:jooyoung Kim <j0.kim@samsung.com>, sanghyun Lee, gun Kim
-Description:Unit test for SLP IDE
-Category:IDE/SLP IDE/Plugins/UnitTest
-Depends:
-Size: 2085403
-Path: /UnitTest_1.16.246_windows.zip
-SHA256: 8176c23c1885cfb1e464030f6bbb0bd8daaf2e1bbd805bd97b49ab05f8660592
-
-Package: Profiler
-Version: 1.0
-Architecture: i386
-Maintainer: Jaewon Lim <jaewon81.lim@samsung.com>, Juyoung Kim
-Description: Samsung Linux Platform IDE
-Category: IDE/SLP IDE/Plugins/Dynamic analysis
-Size: 43006227
-Path: /profiler_1.0.247_windows.zip
-SHA256: d35b8bf41bfe9f3a4662a9e4c184c64d033fc55de97a2108432c0fc94ed84008
-
-Package:CodeCoverage
-Version:1.0
-Maintainer:juyung Kim <j0.kim@samsung.com>, jeonghwan Kim <jeonghwan0613.kim@samsung.com>
-Description:CodeCoverage
-Category:IDE/SLP IDE/Plugins/CodeCoverage
-Depends:
-Size: 326181
-Path: /CodeCoverage_1.0.258_windows.zip
-SHA256: 86e47fc38a1cae8011ab2872db0ac7f772354cb4307c00e28cdb46636ad27a07
-
-Package:GUIBuilderPlugins
-Version:0.3.294
-Maintainer: Changhun Lim <changhun.lim@samsung.com>, Hyunjun Son <hj79.son@samsung.com>, Jaeyeol Lee <jaeyeol148.lee@samsung.com>, Yonghwan Jeon <yonghwan82.jeon@samsung.com>
-Description: GUI Builder PlugIns
-Category: IDE/SLP IDE/Plugins/GUIBuilderPlugins
-Depends: slp-ide , GUIBuilder
-Size: 71394
-Path: /GUIBuilderPlugins_0.3.294_windows.zip
-SHA256: 39f4f687f3664a53885a7a07dfb467f1663154af437d93c09ee23e95ec1119e8
-
-Package: meta1
-Version: 0.1
-Maintainer: cho
-Description: meta1
-Depends: p1
-Conflict: 
-Size: 0
-Path: /meta1.zip
-Attribute: root
-
-Package: p1
-Version: 0.1
-Maintainer: cho
-Description: p1
-Depends: p2
-Conflict: 
-Size: 0
-Path: /p1.zip
-
-Package: p2
-Version: 0.1
-Maintainer: cho
-Description: p2
-Depends: meta1
-Conflict: 
-Size: 0
-Path: /p2.zip
-
-Package: p3
-Version: 0.1
-Maintainer: cho
-Description: p3
-Depends: nopackage
-Conflict: 
-Size: 0
-Path: /p3.zip
-
diff --git a/unittest/src/com/samsung/installmanager/tests/installedpackage.list b/unittest/src/com/samsung/installmanager/tests/installedpackage.list
deleted file mode 100644 (file)
index d0be0c7..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-Package: EventInjector_Wac
-Version: 1.1
-Architecture: i386
-Maintainer: juyung Kim <j0.kim@samsung.com>, jaewon lim <jaewon81.lim@samsung.com>, sungmin Ha <sungmin82.ha@samsung.com>
-Description: EventInjector for emulator
-Install-script: 
-Remove-script: 
-Category: IDE/WAC IDE/Plugins/EventInjector
-Size: 206116
-Path: ./eventinjector_wac_1.1.245_windows.zip
-SHA256: e50c8b54d46d119468b36850b98ae8e53c81a628668d6f5fbc59493a2704d2f8
-Status: INSTALLED_OK
-Installed-directory: c:/samsung-sdk
-
-Package: slp-emulator-image
-Version: 1.1.86
-Maintainer: Yeong-Kyoon, Lee <yeongkyoon.lee@samsung.com> Dong-Kyun, Yun <dk77.yun@samsung.com>
-Description: Samsung Linux Platform Emulator Image
-Remove-script: remove.bat
-Category: SDK/Emulator
-Size: 221007566
-Path: ./emulator-image_1.1.86_windows.zip
-SHA256: 68fcc94883592e1d3b8366ed703165c12ec76e560f2ebab8caba487d55667f53
-Status: INSTALLED_OK
-Installed-directory: c:/samsung-sdk
-
-Package: sdb
-Version: 0.1.35
-Maintainer: Hoon Kang <h245.kang@samsung.com>, Joogwan Kim
-Description: Smart Development Bridge for device management
-Remove-script: remove.bat
-Size: 146872
-Path: /sdb_0.1.35_windows.zip
-SHA256: 1dffb8554c1a15682313dec96039bc1f3eb2177ed276ec1f15061583987217f4
-Status: INSTALLED_OK
-Installed-directory: c:/samsung-sdk
-
-Package: EMULATOR
-Version: 0.16.63
-Maintainer: JongHwan Park <jonghwan2.park@samsung.com>
-Depends: slp-emulator, slp-emulator-image
-Description: Install EMULATOR.
-Attribute: root
-Category: /
-Size: 476
-Path: ./EMULATOR_0.16.63_windows.zip
-SHA256: cb1914c7d2a0318327cce3f5a398eb289a2361d1def4827d5a1c83108f0f03fd
-Status: INSTALLED_OK
-Installed-directory: c:/samsung-sdk
-
-Package: slp-emulator
-Version: 1.1.213
-Maintainer: Yeong-Kyoon, Lee <yeongkyoon.lee@samsung.com> Dong-Kyun, Yun <dk77.yun@samsung.com>
-Description: Samsung Linux Platform Emulator
-Install-script: install.bat
-Remove-script: remove.bat
-Category: SDK/Emulator
-Size: 24493356
-Path: ./emulator_1.1.213_windows.zip
-SHA256: 793ac5e692faecc7e8749392fc93883078954c058a298171ad9da2909591c458
-Status: INSTALLED_OK
-Installed-directory: c:/samsung-sdk
-
-Package: info
-Version: 1.0.224
-Maintainer: JongHwan Park<jonghwan2.park@samsung.com>
-Description: information document for sdk-slp
-Category: SDK
-Size: 42649
-Path: /info_1.0.224_windows.zip
-SHA256: f5c91a5a05f59b0dd03e1a3cfb3022b48ca4146295b09e8b43947b595ee69a32
-Status: INSTALLED_OK
-Installed-directory: c:/samsung-sdk
-
-Package: WAC_IDE
-Version: 0.16.71
-Maintainer: JongHwan Park <jonghwan2.park@samsung.com>
-Depends: wac-ide, EventInjector_Wac, info, sdb
-Description: Install WAC IDE.
-Attribute: root
-Category: /
-Size: 487
-Path: /WAC_IDE_0.16.71_windows.zip
-SHA256: 62f972aef511cf72145823ad8d44b86e7ec5c7490056159ba18e0e72e28b947b
-Status: INSTALLED_OK
-Installed-directory: c:/samsung-sdk
-
-Package: wac-ide
-Version: 1.16.221
-Maintainer: kangho kim <kh5325.kim@samsung.com> jihoon song<jihoon80.song@samsung.com>
-Description: Samsung Linux Platform WAC IDE
-Category: IDE/WAC IDE/Workbench
-Install-script: install.bat
-Remove-script: remove.bat
-Size: 181060397
-Path: /wac-ide_0.16.221_windows.zip
-SHA256: 3d4169b08a067bb0ffa582a2f96b05e3784249d6a3de4f0ba278952da33ffcec
-Status: INSTALLED_OK
-Installed-directory: c:/samsung-sdk
-
diff --git a/unittest/src/org/tizen/installmanager/util/TestResourceHandler.java b/unittest/src/org/tizen/installmanager/util/TestResourceHandler.java
deleted file mode 100644 (file)
index 1683527..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-package org.tizen.installmanager.util;
-
-import static org.junit.Assert.*;
-
-import java.io.*;
-
-import org.junit.Test;
-
-public class TestResourceHandler {
-
-       /**
-        * Test for closeSilently method.
-        * 
-        * @author Sungho Park <chywoo.park@samsung.com>
-        * @throws Exception
-        */
-       @Test
-       public void testCloseObjectSilently() throws Exception {
-
-               FileOutputStream fos = new FileOutputStream("testfile");
-               FileInputStream fis = new FileInputStream("testfile");
-               File file = new File("testfile");
-               
-               file.deleteOnExit();
-               
-               ResourceHandler.closeObjectSilently(fis);
-               ResourceHandler.closeObjectSilently(fos);
-               ResourceHandler.closeObjectSilently(file);
-       }
-
-}