Replaced indexOf() with contains() method.

This commit is contained in:
MobiusDev
2018-09-09 19:05:28 +00:00
parent dce4f54d60
commit d33bfa17b2
10 changed files with 10 additions and 10 deletions

View File

@ -69,7 +69,7 @@ public class DatabaseBackup
}
// Dump to file.
final String mysqldumpPath = System.getProperty("os.name").toLowerCase().indexOf("win") >= 0 ? Config.MYSQL_BIN_PATH : "";
final String mysqldumpPath = System.getProperty("os.name").toLowerCase().contains("win") ? Config.MYSQL_BIN_PATH : "";
try
{
final Process process = Runtime.getRuntime().exec(mysqldumpPath + "mysqldump -u " + Config.DATABASE_LOGIN + (Config.DATABASE_PASSWORD.trim().isEmpty() ? "" : " -p" + Config.DATABASE_PASSWORD) + " " + Config.DATABASE_URL.replace("jdbc:mariadb://", "").replaceAll(".*\\/|\\?.*", "") + " -r " + Config.BACKUP_PATH + (Server.serverMode == Server.MODE_GAMESERVER ? "game" : "login") + new SimpleDateFormat("_yyyy_MM_dd_HH_mm'.sql'").format(new Date()));