[Title]
authorshihyun.kim <shihyun.kim@samsung.com>
Mon, 5 Aug 2013 06:38:42 +0000 (15:38 +0900)
committershihyun.kim <shihyun.kim@samsung.com>
Mon, 5 Aug 2013 06:38:42 +0000 (15:38 +0900)
* improve performance
** remove flush() func.

InstallManager_java/src/org/tizen/installmanager/core/Performance.java
InstallManager_java/src/org/tizen/installmanager/lib/Log.java
InstallManager_java/src/org/tizen/installmanager/lib/win/WindowsSDKPackageFormat.java

index b9c050a..24aede6 100644 (file)
@@ -110,6 +110,8 @@ public class Performance {
                        
                        out.write("***  InstallManager performance test ***");
                        out.newLine();
+                       out.write("Sdk package size\t: " + sdkPackageSize);
+                       out.newLine();
                        out.write("The initialization time\t: " + getInitializeTime() + "sec");
                        out.write("(" + getBitPerSecond(sdkPackageSize, getInitializeTime())+ "b/s)");
                        out.newLine();
@@ -141,13 +143,13 @@ public class Performance {
                                                        
                } catch (IOException e) {
                        Log.ExceptionLog(e);
-               }
-               
-               if (out != null) {
-                       try {
-                               out.close();
-                       } catch (IOException e) {
-                               Log.ExceptionLog(e);
+               } finally {
+                       if (out != null) {
+                               try {
+                                       out.close();
+                               } catch (IOException e) {
+                                       Log.ExceptionLog(e);
+                               }
                        }
                }
        }
index aa47da1..c23c12e 100644 (file)
@@ -166,7 +166,6 @@ public class Log {
                try {
                        objfile.write(bufLogTitle.toString());
                        objfile.write(newLine);
-                       objfile.flush();
                } catch (IOException e) {
                        Log.ExceptionLog(e);
                }
@@ -218,7 +217,6 @@ public class Log {
                try {
                        objfile.write(timeStr() + " " + str);
                        objfile.write(newLine);
-                       objfile.flush();
                } catch (IOException e) {
                        // TODO
                        Log.ExceptionLog(e);
index 80da4f4..a89d9f5 100644 (file)
@@ -35,6 +35,7 @@ import java.io.IOException;
 import java.util.zip.ZipEntry;
 import java.util.zip.ZipInputStream;
 
+import org.apache.commons.io.IOUtils;
 import org.tizen.installmanager.core.IMFatalException;
 import org.tizen.installmanager.lib.IIMProgressMonitor;
 import org.tizen.installmanager.lib.Log;
@@ -145,21 +146,11 @@ public class WindowsSDKPackageFormat extends SDKPackageFormat{
 
                                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();
                                }
@@ -184,6 +175,7 @@ public class WindowsSDKPackageFormat extends SDKPackageFormat{
                } finally {
                        try {
                                if (zipOutput != null) {
+                                       zipOutput.flush();
                                        zipOutput.close();
                                }
                        } catch (IOException e) {