Add DEFAULT_PORT

This commit is contained in:
Adeel Zafar 2019-08-18 23:41:40 +05:00
parent bf9898b5bc
commit 04cf0398c6

View File

@ -20,6 +20,7 @@ import org.kiwix.kiwixlib.JNIKiwixServer;
public class WebServerHelper { public class WebServerHelper {
public static boolean isServerStarted; public static boolean isServerStarted;
private static int port; private static int port;
private final int DEFAULT_PORT = 8080;
private final JNIKiwixLibrary kiwixLibrary = new JNIKiwixLibrary(); private final JNIKiwixLibrary kiwixLibrary = new JNIKiwixLibrary();
private final JNIKiwixServer kiwixServer = new JNIKiwixServer(kiwixLibrary); private final JNIKiwixServer kiwixServer = new JNIKiwixServer(kiwixLibrary);
private static final String TAG = "WebServerHelper"; private static final String TAG = "WebServerHelper";
@ -53,7 +54,7 @@ public class WebServerHelper {
private boolean startAndroidWebServer(ArrayList<String> selectedBooksPath) { private boolean startAndroidWebServer(ArrayList<String> selectedBooksPath) {
if (!isServerStarted) { if (!isServerStarted) {
port = 8080; port = DEFAULT_PORT;
//Call to start server //Call to start server
for (String path : selectedBooksPath) { for (String path : selectedBooksPath) {
try { try {