📄 htmlapplicationtype.java
字号:
/*
* SSL-Explorer
*
* Copyright (C) 2003-2006 3SP LTD. All Rights Reserved
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
package com.sslexplorer.vpn.util.types;
import java.io.IOException;
import java.net.URLEncoder;
import java.util.Enumeration;
import com.sslexplorer.vpn.util.ApplicationLauncher;
import com.sslexplorer.vpn.util.ApplicationLauncherEvents;
import com.sslexplorer.vpn.util.ApplicationType;
import com.sslexplorer.vpn.util.ProcessMonitor;
import com.sslexplorer.vpn.util.XMLElement;
import com.sslexplorer.vpn.util.Tunnel;
public class HtmlApplicationType implements ApplicationType {
private ApplicationLauncherEvents events;
private ApplicationLauncher launcher;
/*
* (non-Javadoc)
*
* @see com.sslexplorer.vpn.util.ApplicationType#prepare(com.sslexplorer.vpn.util.ApplicationLauncher,
* com.sslexplorer.vpn.util.XMLElement)
*/
public void prepare(ApplicationLauncher launcher, ApplicationLauncherEvents events, XMLElement element) throws IOException {
this.launcher = launcher;
this.events = events;
}
public void start() {
}
/*
* (non-Javadoc)
*
* @see com.sslexplorer.vpn.util.ApplicationType#checkFileCondition(com.sslexplorer.vpn.util.XMLElement)
*/
public boolean checkFileCondition(XMLElement el) throws IOException, IllegalArgumentException {
throw new IllegalArgumentException("No supported attributes in condition.");
}
/*
* (non-Javadoc)
*
* @see com.sslexplorer.vpn.util.ApplicationType#getProcessMonitor()
*/
public ProcessMonitor getProcessMonitor() {
return null;
}
/*
* (non-Javadoc)
*
* @see com.sslexplorer.vpn.util.ApplicationType#getRedirectParameters()
*/
public String getRedirectParameters() {
StringBuffer buf = new StringBuffer();
for (Enumeration e = launcher.getTunnels().elements(); e.hasMoreElements();) {
Tunnel l = (Tunnel) e.nextElement();
if (buf.length() == 0) {
buf.append("tunnels=");
} else {
buf.append(",");
}
buf.append(l.getName());
buf.append(":");
buf.append("localhost");
buf.append(":");
buf.append(l.getSourcePort());
buf.append("&");
}
buf.append("sslexplorer=");
buf.append(URLEncoder.encode(launcher.getApplicationStoreProtocol() + "://" +
launcher.getApplicationStoreHost() + ":" + launcher.getApplicationStorePort()));
return buf.toString();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -