Some small changes to method names
This commit is contained in:
parent
4ece2b0cd2
commit
1053713d15
13 changed files with 61 additions and 167 deletions
|
|
@ -2,12 +2,15 @@ package wa.server;
|
|||
|
||||
import java.io.File;
|
||||
|
||||
import zutil.db.DBConnection;
|
||||
import zutil.osal.OSAbstractionLayer;
|
||||
import zutil.osal.OSAbstractionLayer.OSType;
|
||||
|
||||
public class WAConstants {
|
||||
|
||||
public static final String DB_FILE_NAME = "webadmin.db";
|
||||
public static final String DB_TABLE_PREFIX = "wa";
|
||||
|
||||
public static DBConnection db;
|
||||
|
||||
public static final String WA_ROOT_PATH_LINUX = "/";
|
||||
public static final String WA_ROOT_PATH_WINDOWS = "C:\\webadmin\\";
|
||||
|
|
@ -22,7 +25,7 @@ public class WAConstants {
|
|||
|
||||
static{
|
||||
OSAbstractionLayer os = OSAbstractionLayer.getInstance();
|
||||
|
||||
|
||||
if(os.getOSType() == OSType.Linux){
|
||||
configPath = new File(WA_ROOT_PATH_LINUX + WA_BASE_CONFIG_PATH);
|
||||
}
|
||||
|
|
@ -32,10 +35,23 @@ public class WAConstants {
|
|||
else {
|
||||
configPath = null;
|
||||
}
|
||||
|
||||
if(configPath != null){
|
||||
try {
|
||||
db = new DBConnection(DBConnection.DBMS.SQLite, configPath.getAbsolutePath() + DB_FILE_NAME);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
System.exit(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static File getConfigFile(String name){
|
||||
return new File(configPath, name);
|
||||
}
|
||||
|
||||
public static DBConnection getDB(){
|
||||
return db;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue