Revert "[Title] modified RdsDeploy class for modularization." 57/11357/1
authorGun Kim <gune.kim@samsung.com>
Fri, 25 Oct 2013 01:48:17 +0000 (10:48 +0900)
committerGun Kim <gune.kim@samsung.com>
Fri, 25 Oct 2013 01:49:32 +0000 (10:49 +0900)
Because, this commit must be merged with webapp-eplugin, but it isn't.

This reverts commit 7dfdc6544bb0a9c266da59051c613c17a70a0927.

Change-Id: Ieb7ff84ac29207dd6ecd9a42e53f781e711a32f0
Signed-off-by: Gun Kim <gune.kim@samsung.com>
org.tizen.common/src/org/tizen/common/rds/RdsDeployer.java

index 8b296cb..2cb97a5 100644 (file)
@@ -36,7 +36,6 @@ import org.eclipse.core.resources.IProject;
 import org.eclipse.core.resources.IResource;
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
 import org.eclipse.core.runtime.Status;
 import org.eclipse.osgi.util.NLS;
 import org.slf4j.Logger;
@@ -97,12 +96,11 @@ public abstract class RdsDeployer implements Closeable {
      */
     protected abstract String getPkgId();
     /**
-     * Signs project incrementally.
-     * This method is called by {@link RdsDeployer#deploy()}.
+     * Deploys using RDS.
      * 
-     * @return If this method returns false, {@link RdsDeployer#deploy()} fails and returns false.
+     * @return boolean
      */
-    protected abstract boolean sign( List<DeltaResourceInfo> deltaInfoList) throws CoreException, IOException, IllegalStateException;
+    public abstract boolean deploy() throws CoreException;
     
     public RdsDeployer( IProject project, IDevice device, ISdbCommandHelper tizenCommand, ITizenConsoleManager console, String pkgType, IProgressMonitor monitor) {
         this.project = project;
@@ -113,91 +111,7 @@ public abstract class RdsDeployer implements Closeable {
         this.pkgType = pkgType;
         this.strAppInstallPath = getAppInstallPath();
         deltaDetector = new RdsDeltaDetector(device, project, strAppInstallPath);
-    }
-    
-    /**
-     * Executes job that is needed before {@link RdsDeployer#deploy()} is executed.
-     * This method works as soon as the {@link RdsDeployer#deploy()} is executed.
-     * If you doesn't implement it in your subclass, returns true.
-     * 
-     * @return If this method returns false, {@link RdsDeployer#deploy()} doesn't execute and returns false.
-     */
-    protected boolean preDeploy() throws CoreException {
-        return true;
-    }
-    
-    /**
-     * Deploys using RDS.
-     * 
-     * @return boolean
-     */
-    public boolean deploy() throws CoreException {
-        if ( !preDeploy() ) {
-            return false;
-        }
-        
-        // finds interestDelta for sign
-        List<DeltaResourceInfo> deltaInfoList = getInterestDelta();
-        if ( deltaInfoList == null ) {
-            return false;
-        }
-        if ( deltaInfoList.isEmpty()) {
-            return true;
-        }
         
-        final String failToSignMsg = "failed to sign for RDS";
-        try {
-            if ( !sign(deltaInfoList) ) {
-                printInfo(failToSignMsg);
-                return false;
-            }
-        } catch (Exception e) {
-            printInfo(failToSignMsg);
-            logger.error(failToSignMsg, e);
-            return false;
-        }
-
-        // finds interestDelta for to deploy project with RDS mode
-        cleanDeltaInfo();
-        deltaInfoList = getInterestDelta();
-        if ( deltaInfoList == null ) {
-            return false;
-        }
-
-        if ( deltaInfoList.isEmpty()) {
-            return true;
-        }
-        
-        try {
-            partialInstall(deltaInfoList);
-        }
-        catch ( CoreException e ) {
-            logger.error(RdsMessages.CANNOT_PARTIALLY_INSTALL, e);
-            printInfo(RdsDeployer.makeRdsLog(RdsMessages.CANNOT_PARTIALLY_INSTALL));
-            return false;
-        }
-        return true;
-    }
-    
-    /**
-     * Returns a delta list interested.
-     */
-    private List<DeltaResourceInfo> getInterestDelta() {
-        List<DeltaResourceInfo> deltaInfoList = null;
-        try {
-            project.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
-            deltaInfoList = getDelta();
-            if ( deltaInfoList == null ) {
-                newCoreException(RdsMessages.CANNOT_FIND_DELTA, null);
-            }
-            
-            deltaInfoList = getInterestDelta(deltaInfoList);
-        } catch (CoreException e) {
-            printInfo(RdsDeployer.makeRdsLog(RdsMessages.CANNOT_FIND_DELTA));
-            return null;
-        }
-
-        return deltaInfoList;
     }
     
     public void setInterestList( List<DeltaResourceInfo> list) {