mconfig.java

来自「httptunnel.jar httptunnel java 源码」· Java 代码 · 共 72 行

JAVA
72
字号
package net.jumperz.app.MTcpProxy;

import java.io.*;
import java.util.*;

public class MConfig
{
private static MConfig instance = new MConfig();

private File configFile;
private Properties prop;
private int threadCount;
private String logFileName;
private String host;
private String targetHost;
private int port;
private int targetPort;
//-----------------------------------------------------------------------------------
private MConfig()
{
	// privatge !
}
//-----------------------------------------------------------------------------------
public static MConfig getInstance()
{
return instance;
}
//-----------------------------------------------------------------------------------
public void load( String configFileName )
throws IOException
{
configFile = new File( configFileName );

prop = new Properties();
prop.load( new FileInputStream( configFile ) );

threadCount		= Integer.parseInt( prop.getProperty( "threadCount" ) );
logFileName		= prop.getProperty( "logFileName" );

port		= Integer.parseInt( prop.getProperty( "port" ) );
targetPort	= Integer.parseInt( prop.getProperty( "targetPort" ) );
host		= prop.getProperty( "host" );
targetHost	= prop.getProperty( "targetHost" );
}
//-----------------------------------------------------------------------------------
public String getLogFileName()
{
return logFileName;
}
//-----------------------------------------------------------------------------------
public int getThreadCount()
{
return threadCount;
}
//-----------------------------------------------------------------------------------
public String getHost() {
	return host;
}

public int getPort() {
	return port;
}

public String getTargetHost() {
	return targetHost;
}

public int getTargetPort() {
	return targetPort;
}

}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?