Moved IOHelper

This commit is contained in:
Norbi Peti 2016-08-04 13:19:25 +02:00
parent 2dcad63c81
commit 2fdd37385c
10 changed files with 38 additions and 37 deletions

View file

@ -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;

View file

@ -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 {

View file

@ -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 {

View file

@ -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 {

View file

@ -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;
}

View file

@ -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

View file

@ -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

View file

@ -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 {

View file

@ -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 {

View file

@ -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 {