2015-04-09 21:22:47 +00:00
|
|
|
package wa.server;
|
|
|
|
|
|
2015-07-15 12:58:30 +00:00
|
|
|
import zutil.db.DBConnection;
|
2015-04-09 21:22:47 +00:00
|
|
|
import zutil.osal.OSAbstractionLayer;
|
|
|
|
|
import zutil.osal.OSAbstractionLayer.OSType;
|
|
|
|
|
|
2016-03-04 17:55:30 +01:00
|
|
|
import java.io.File;
|
|
|
|
|
|
2015-04-09 21:22:47 +00:00
|
|
|
public class WAConstants {
|
2015-07-15 12:58:30 +00:00
|
|
|
|
2016-04-07 14:30:07 +02:00
|
|
|
public static final String DB_FILE = "webadmin.db";
|
|
|
|
|
public static final String DB_DEFAULT_FILE = "webadmin_default.db";
|
2015-04-09 21:22:47 +00:00
|
|
|
public static final String DB_TABLE_PREFIX = "wa";
|
2015-06-02 15:48:21 +00:00
|
|
|
|
|
|
|
|
public static final String WA_ROOT_PATH_LINUX = "/";
|
|
|
|
|
public static final String WA_ROOT_PATH_WINDOWS = "C:\\webadmin\\";
|
|
|
|
|
public static final String WA_BASE_CONFIG_PATH = "etc/webadmin/";
|
|
|
|
|
private static final File configPath;
|
|
|
|
|
|
2015-04-09 21:22:47 +00:00
|
|
|
public static final String WA_SSL_CERT = "cert/server.crt";
|
|
|
|
|
public static final String WA_SSL_KEY = "cert/server.key";
|
|
|
|
|
|
|
|
|
|
public static final String WA_CONFIG_BOUNDARY = "---- WebAdmin Configuration ----";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static{
|
|
|
|
|
OSAbstractionLayer os = OSAbstractionLayer.getInstance();
|
2015-07-15 12:58:30 +00:00
|
|
|
|
2015-04-09 21:22:47 +00:00
|
|
|
if(os.getOSType() == OSType.Linux){
|
2015-06-02 15:48:21 +00:00
|
|
|
configPath = new File(WA_ROOT_PATH_LINUX + WA_BASE_CONFIG_PATH);
|
2015-04-09 21:22:47 +00:00
|
|
|
}
|
|
|
|
|
else if(os.getOSType() == OSType.Windows){
|
2015-06-02 15:48:21 +00:00
|
|
|
configPath = new File(WA_ROOT_PATH_WINDOWS + WA_BASE_CONFIG_PATH);
|
2015-04-09 21:22:47 +00:00
|
|
|
}
|
2015-06-02 15:48:21 +00:00
|
|
|
else {
|
|
|
|
|
configPath = null;
|
|
|
|
|
}
|
2015-04-09 21:22:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static File getConfigFile(String name){
|
2015-06-02 15:48:21 +00:00
|
|
|
return new File(configPath, name);
|
2015-04-09 21:22:47 +00:00
|
|
|
}
|
2015-07-15 12:58:30 +00:00
|
|
|
|
2015-04-09 21:22:47 +00:00
|
|
|
}
|