Added checkstyle plugin

Moved resources to correct folder
Fixed and improved build information, no longer tracking build.properties
This commit is contained in:
JeromSar
2015-11-22 19:26:47 +01:00
parent 89a317b7df
commit a0058869c9
174 changed files with 1302 additions and 617 deletions

View File

@ -7,6 +7,7 @@ import static org.apache.commons.lang3.StringEscapeUtils.escapeHtml4;
public class HTMLGenerationTools
{
private HTMLGenerationTools()
{
throw new AssertionError();

View File

@ -10,6 +10,7 @@ import me.totalfreedom.totalfreedommod.util.FLog;
public abstract class HTTPDModule
{
protected final String uri;
protected final Method method;
protected final Map<String, String> headers;

View File

@ -4,6 +4,7 @@ import me.totalfreedom.totalfreedommod.httpd.NanoHTTPD.Response;
public class HTTPDPageBuilder
{
private static final String TEMPLATE = "<!DOCTYPE html>\r\n"
+ "<html>\r\n"
+ "<head>\r\n"

View File

@ -12,6 +12,7 @@ import org.apache.commons.lang3.StringUtils;
public class Module_dump extends HTTPDModule
{
private File echoFile = null;
private final String body;

View File

@ -21,6 +21,7 @@ import org.apache.commons.lang3.StringUtils;
*/
public class Module_file extends HTTPDModule
{
private final File rootDir = new File(ConfigEntry.HTTPD_PUBLIC_FOLDER.getString());
public static final Map<String, String> MIME_TYPES = new HashMap<String, String>();
@ -302,7 +303,7 @@ public class Module_file extends HTTPDModule
}
}
List<String> _files = Arrays.asList(f.list(new FilenameFilter()
List<String> files = Arrays.asList(f.list(new FilenameFilter()
{
@Override
public boolean accept(File dir, String name)
@ -310,7 +311,7 @@ public class Module_file extends HTTPDModule
return new File(dir, name).isFile();
}
}));
Collections.sort(_files);
Collections.sort(files);
List<String> directories = Arrays.asList(f.list(new FilenameFilter()
{
@Override
@ -320,7 +321,7 @@ public class Module_file extends HTTPDModule
}
}));
Collections.sort(directories);
if (up != null || directories.size() + _files.size() > 0)
if (up != null || directories.size() + files.size() > 0)
{
msg += "<ul>";
if (up != null || directories.size() > 0)
@ -337,12 +338,12 @@ public class Module_file extends HTTPDModule
}
msg += "</section>";
}
if (_files.size() > 0)
if (files.size() > 0)
{
msg += "<section class=\"files\">";
for (int i = 0; i < _files.size(); i++)
for (int i = 0; i < files.size(); i++)
{
String file = _files.get(i);
String file = files.get(i);
msg += "<li><a href=\"" + encodeUri(uri + file) + "\"><span class=\"filename\">" + file + "</span></a>";
File curFile = new File(f, file);

View File

@ -8,11 +8,11 @@ import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
import me.totalfreedom.totalfreedommod.commands.FreedomCommand;
import static me.totalfreedom.totalfreedommod.httpd.HTMLGenerationTools.heading;
import static me.totalfreedom.totalfreedommod.httpd.HTMLGenerationTools.paragraph;
import me.totalfreedom.totalfreedommod.rank.PlayerRank;
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
import net.pravian.aero.command.CommandReflection;
import static org.apache.commons.lang3.StringEscapeUtils.escapeHtml4;
import org.apache.commons.lang3.StringUtils;
@ -23,6 +23,7 @@ import org.bukkit.command.SimpleCommandMap;
public class Module_help extends HTTPDModule
{
public Module_help(NanoHTTPD.HTTPSession session)
{
super(session);
@ -136,6 +137,7 @@ public class Module_help extends HTTPDModule
public static class CommandComparator implements Comparator<Command>
{
@Override
public int compare(Command a, Command b)
{

View File

@ -7,6 +7,7 @@ import org.bukkit.entity.Player;
public class Module_list extends HTTPDModule
{
public Module_list(NanoHTTPD.HTTPSession session)
{
super(session);

View File

@ -5,6 +5,7 @@ import me.totalfreedom.totalfreedommod.TotalFreedomMod;
public class Module_permbans extends HTTPDModule
{
public Module_permbans(NanoHTTPD.HTTPSession session)
{
super(session);

View File

@ -10,6 +10,7 @@ import org.json.simple.JSONObject;
public class Module_players extends HTTPDModule
{
public Module_players(NanoHTTPD.HTTPSession session)
{
super(session);

View File

@ -20,6 +20,7 @@ import org.apache.commons.lang3.StringUtils;
public class Module_schematic extends HTTPDModule
{
private static final File SCHEMATIC_FOLDER = new File("./plugins/WorldEdit/schematics/");
private static final String REQUEST_FORM_FILE_ELEMENT_NAME = "schematicFile";
private static final Pattern SCHEMATIC_FILENAME_LC = Pattern.compile("^[a-z0-9_'!,\\-]{1,30}\\.schematic$");
@ -236,6 +237,7 @@ public class Module_schematic extends HTTPDModule
private static class SchematicTransferException extends Exception
{
public SchematicTransferException()
{
}
@ -248,6 +250,7 @@ public class Module_schematic extends HTTPDModule
private static class ResponseOverrideException extends Exception
{
private final Response response;
public ResponseOverrideException(Response response)
@ -269,6 +272,7 @@ public class Module_schematic extends HTTPDModule
private static enum ModuleMode
{
LIST("list"),
UPLOAD("upload"),
DOWNLOAD("download"),
@ -300,4 +304,5 @@ public class Module_schematic extends HTTPDModule
return INVALID;
}
}
}