@Override
	public void deploy(File zipFile, String targetPath) throws IOException,
			RemoteException {
		// TODO Auto-generated method stub
		if(!zipFile.exists())
		{
			throw new RemoteException(zipFile+" is not exist.");
		}
		targetPath = pathStrConvert(targetPath);
		ArrayList<String> result = new ArrayList<String>(0);
		ArrayList<String> errorResult = new ArrayList<String>(0);
		
		// copy the local file zipFile to targetPath of remote host
		if (this.scopy(conncontroller, zipFile, targetPath) == true) {
			//System.out.println("222---"+targetPath+zipFile.getName().substring(0,zipFile.getName().toString().indexOf(".zip")));
		boolean unzipflag=isUnzipAddDirectory(targetPath,zipFile.getName());
		if (isExistedDirectory(
					targetPath,
					zipFile.getName().substring(0,
							zipFile.getName().toString().indexOf(".zip")))) {

				if (reDirName(
						targetPath,
						zipFile.getName().substring(0,
								zipFile.getName().toString().indexOf(".zip")),
						"_bak") == false) {
					
					throw new RemoteException(errorResult.toString());
				}
			}
			//System.out.println(zipFile.getName());
			
			result.clear();
			errorResult.clear();
			String cmd;
			if(unzipflag==false)
			{
				cmd="cd "+targetPath+" && unzip -q "+ zipFile.getName();
			}
			else
			{
				cmd="cd "+targetPath+" && unzip -q -d "+ zipFile.getName().substring(0,
						zipFile.getName().toString().indexOf(".zip"))+" " + zipFile.getName();
			}
			//System.out.println("333----"+cmd);
			this.reauthInfo.execCommand(conncontroller, cmd, result, errorResult);

			if (result.isEmpty() && errorResult.isEmpty()) {
				// System.out.println("Unzip successfully!");
				if (deleteFile(targetPath, zipFile.getName()) == false) {
					throw new RemoteException("zipFile deleted failed.");
				} else {
					// System.out.println("zipFile deleted successfully!");
				}
			} else
				throw new RemoteException("unzip failed");
		}

	}