1 19 20 package com.sslexplorer.agent.client.util.types; 21 22 import java.io.IOException ; 23 import java.net.URLEncoder ; 24 import java.util.Enumeration ; 25 26 import com.sslexplorer.agent.client.util.AbstractApplicationLauncher; 27 import com.sslexplorer.agent.client.util.ApplicationLauncherEvents; 28 import com.sslexplorer.agent.client.util.ApplicationType; 29 import com.sslexplorer.agent.client.util.ProcessMonitor; 30 import com.sslexplorer.agent.client.util.TunnelConfiguration; 31 import com.sslexplorer.agent.client.util.XMLElement; 32 33 40 public class HtmlApplicationType implements ApplicationType { 41 42 private AbstractApplicationLauncher launcher; 43 44 50 public void prepare(AbstractApplicationLauncher launcher, ApplicationLauncherEvents events, XMLElement element) throws IOException { 51 this.launcher = launcher; 52 } 53 54 public void start() { 55 56 } 57 58 63 public ProcessMonitor getProcessMonitor() { 64 return null; 65 } 66 67 72 public String getRedirectParameters() { 73 StringBuffer buf = new StringBuffer (); 74 for (Enumeration e = launcher.getTunnels().elements(); e.hasMoreElements();) { 75 TunnelConfiguration l = (TunnelConfiguration) e.nextElement(); 76 if (buf.length() == 0) { 77 buf.append("tunnels="); } else { 79 buf.append(","); } 81 buf.append(l.getName()); 82 buf.append(":"); buf.append("localhost"); buf.append(":"); buf.append(l.getSourcePort()); 86 buf.append("&"); } 88 buf.append("sslexplorer="); buf.append(URLEncoder.encode(launcher.getApplicationStoreProtocol() + "://" + launcher.getApplicationStoreHost() 91 + ":" + launcher.getApplicationStorePort())); 93 return buf.toString(); 94 } 95 96 99 public String getTypeName() { 100 return "html"; 101 } 102 103 } 104 | Popular Tags |