37 lines
1,014 B
Java
37 lines
1,014 B
Java
|
|
package wa.server;
|
||
|
|
|
||
|
|
import java.io.File;
|
||
|
|
|
||
|
|
import zutil.osal.OSAbstractionLayer;
|
||
|
|
import zutil.osal.OSAbstractionLayer.OSType;
|
||
|
|
|
||
|
|
public class WAConstants {
|
||
|
|
public static final String DB_TABLE_PREFIX = "wa";
|
||
|
|
|
||
|
|
public static String WA_BASE_CONFIG_PATH;
|
||
|
|
public static final String WA_BASE_CONFIG_PATH_LINUX = "/etc/webadmin";
|
||
|
|
public static final String WA_BASE_CONFIG_PATH_WINDOWS = ".";
|
||
|
|
|
||
|
|
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();
|
||
|
|
|
||
|
|
if(os.getOSType() == OSType.Linux){
|
||
|
|
WA_BASE_CONFIG_PATH = WA_BASE_CONFIG_PATH_LINUX;
|
||
|
|
}
|
||
|
|
else if(os.getOSType() == OSType.Windows){
|
||
|
|
WA_BASE_CONFIG_PATH = WA_BASE_CONFIG_PATH_WINDOWS;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
public static File getConfigFile(String name){
|
||
|
|
return new File(WA_BASE_CONFIG_PATH, name);
|
||
|
|
}
|
||
|
|
}
|