Moved IOHelper
This commit is contained in:
parent
2dcad63c81
commit
2fdd37385c
10 changed files with 38 additions and 37 deletions
|
@ -1,4 +1,4 @@
|
|||
package io.github.norbipeti.chat.server;
|
||||
package io.github.norbipeti.chat.server.io;
|
||||
|
||||
import java.io.BufferedOutputStream;
|
||||
import java.io.ByteArrayInputStream;
|
||||
|
|
|
@ -7,12 +7,13 @@ import org.apache.logging.log4j.LogManager;
|
|||
import org.jsoup.nodes.Element;
|
||||
|
||||
import com.sun.net.httpserver.HttpExchange;
|
||||
import io.github.norbipeti.chat.server.IOHelper;
|
||||
|
||||
import io.github.norbipeti.chat.server.data.DataManager;
|
||||
import io.github.norbipeti.chat.server.db.domain.Conversation;
|
||||
import io.github.norbipeti.chat.server.db.domain.Message;
|
||||
import io.github.norbipeti.chat.server.db.domain.MessageChunk;
|
||||
import io.github.norbipeti.chat.server.db.domain.User;
|
||||
import io.github.norbipeti.chat.server.io.IOHelper;
|
||||
|
||||
public class IndexPage extends Page {
|
||||
|
||||
|
|
|
@ -6,9 +6,9 @@ import org.mindrot.jbcrypt.BCrypt;
|
|||
import com.google.gson.JsonObject;
|
||||
import com.sun.net.httpserver.HttpExchange;
|
||||
|
||||
import io.github.norbipeti.chat.server.IOHelper;
|
||||
import io.github.norbipeti.chat.server.data.DataManager;
|
||||
import io.github.norbipeti.chat.server.db.domain.User;
|
||||
import io.github.norbipeti.chat.server.io.IOHelper;
|
||||
|
||||
public class LoginAjaxPage extends Page {
|
||||
|
||||
|
|
|
@ -4,8 +4,8 @@ import java.io.IOException;
|
|||
|
||||
import com.sun.net.httpserver.HttpExchange;
|
||||
|
||||
import io.github.norbipeti.chat.server.IOHelper;
|
||||
import io.github.norbipeti.chat.server.db.domain.User;
|
||||
import io.github.norbipeti.chat.server.io.IOHelper;
|
||||
|
||||
public class LogoutPage extends Page {
|
||||
|
||||
|
|
|
@ -1,28 +1,28 @@
|
|||
package io.github.norbipeti.chat.server.page;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import com.sun.net.httpserver.HttpExchange;
|
||||
|
||||
import io.github.norbipeti.chat.server.IOHelper;
|
||||
|
||||
public class NotFoundPage extends Page {
|
||||
|
||||
@Override
|
||||
public String GetName() {
|
||||
return "notfound";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handlePage(HttpExchange exchange) throws IOException {
|
||||
IOHelper.SendPage(404, this, exchange);
|
||||
}
|
||||
|
||||
public NotFoundPage() {
|
||||
if (Instance != null)
|
||||
throw new UnsupportedOperationException("There can only be one instance of a page.");
|
||||
Instance = this;
|
||||
}
|
||||
|
||||
public static NotFoundPage Instance;
|
||||
}
|
||||
package io.github.norbipeti.chat.server.page;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import com.sun.net.httpserver.HttpExchange;
|
||||
|
||||
import io.github.norbipeti.chat.server.io.IOHelper;
|
||||
|
||||
public class NotFoundPage extends Page {
|
||||
|
||||
@Override
|
||||
public String GetName() {
|
||||
return "notfound";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handlePage(HttpExchange exchange) throws IOException {
|
||||
IOHelper.SendPage(404, this, exchange);
|
||||
}
|
||||
|
||||
public NotFoundPage() {
|
||||
if (Instance != null)
|
||||
throw new UnsupportedOperationException("There can only be one instance of a page.");
|
||||
Instance = this;
|
||||
}
|
||||
|
||||
public static NotFoundPage Instance;
|
||||
}
|
||||
|
|
|
@ -8,8 +8,8 @@ import org.apache.commons.io.output.ByteArrayOutputStream;
|
|||
|
||||
import com.sun.net.httpserver.*;
|
||||
|
||||
import io.github.norbipeti.chat.server.IOHelper;
|
||||
import io.github.norbipeti.chat.server.Main;
|
||||
import io.github.norbipeti.chat.server.io.IOHelper;
|
||||
|
||||
/**
|
||||
* Add to {@link Main}.Pages
|
||||
|
|
|
@ -6,9 +6,9 @@ import org.mindrot.jbcrypt.BCrypt;
|
|||
import com.google.gson.JsonObject;
|
||||
import com.sun.net.httpserver.HttpExchange;
|
||||
|
||||
import io.github.norbipeti.chat.server.IOHelper;
|
||||
import io.github.norbipeti.chat.server.data.DataManager;
|
||||
import io.github.norbipeti.chat.server.db.domain.User;
|
||||
import io.github.norbipeti.chat.server.io.IOHelper;
|
||||
|
||||
public class RegisterAjaxPage extends Page {
|
||||
@Override
|
||||
|
|
|
@ -8,7 +8,7 @@ import org.apache.logging.log4j.LogManager;
|
|||
|
||||
import com.sun.net.httpserver.HttpExchange;
|
||||
|
||||
import io.github.norbipeti.chat.server.IOHelper;
|
||||
import io.github.norbipeti.chat.server.io.IOHelper;
|
||||
|
||||
public class ScriptsPage extends Page {
|
||||
|
||||
|
|
|
@ -7,13 +7,13 @@ import org.apache.logging.log4j.LogManager;
|
|||
import com.google.gson.JsonObject;
|
||||
import com.sun.net.httpserver.HttpExchange;
|
||||
|
||||
import io.github.norbipeti.chat.server.IOHelper;
|
||||
import io.github.norbipeti.chat.server.data.DataManager;
|
||||
import io.github.norbipeti.chat.server.data.LoaderCollection;
|
||||
import io.github.norbipeti.chat.server.db.domain.Conversation;
|
||||
import io.github.norbipeti.chat.server.db.domain.Message;
|
||||
import io.github.norbipeti.chat.server.db.domain.MessageChunk;
|
||||
import io.github.norbipeti.chat.server.db.domain.User;
|
||||
import io.github.norbipeti.chat.server.io.IOHelper;
|
||||
|
||||
public class SendMessageAjaxPage extends Page {
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ import org.apache.logging.log4j.LogManager;
|
|||
|
||||
import com.sun.net.httpserver.HttpExchange;
|
||||
|
||||
import io.github.norbipeti.chat.server.IOHelper;
|
||||
import io.github.norbipeti.chat.server.io.IOHelper;
|
||||
|
||||
public class StylePage extends Page {
|
||||
|
||||
|
|
Loading…
Reference in a new issue