Skip to content

Commit

Permalink
burn some unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
alyssaruth committed Oct 30, 2024
1 parent 6bfb8dd commit b2417ac
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 213 deletions.
70 changes: 0 additions & 70 deletions client/src/main/java/online/util/AccountUtil.java

This file was deleted.

3 changes: 0 additions & 3 deletions core/src/main/java/util/EncryptionUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@

public class EncryptionUtil
{
public static final int MINIMUM_PASSWORD_LENGTH = 7;

private static final String ALGORITHM_RSA_ECB_PKCS1PADDING = "RSA/ECB/PKCS1Padding";
private static final String ALGORITHM_AES_ECB_PKCS5PADDING = "AES/ECB/PKCS5Padding";
public static Base64Desktop base64Interface = new Base64Desktop();

Expand Down
75 changes: 0 additions & 75 deletions core/src/main/java/util/StringUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,6 @@

public class StringUtil
{
public static int countOccurences(String str, String stringToCount)
{
int length = str.length();
String strippedStr = str.replace(stringToCount, "");

return length - strippedStr.length();
}

public static ArrayList<String> getListFromDelims(String delimitedStr, String delimChar)
{
ArrayList<String> list = new ArrayList<>();
Expand Down Expand Up @@ -66,22 +58,6 @@ public static String toDelims(ArrayList<? extends Object> list, String delimChar

return sb.toString();
}

public static String toSqlInStatement(ArrayList<String> list, boolean in)
{
StringBuilder sb = new StringBuilder();
if (!in)
{
sb.append("NOT ");
}
sb.append("IN (");

String delimList = "'" + toDelims(list, "','") + "'";
sb.append(delimList);
sb.append(")");

return sb.toString();
}

public static String escapeHtml(String plainText)
{
Expand All @@ -107,55 +83,4 @@ public static String escapeHtml(String plainText)

return sb.toString();
}

public static String convertOrdinalToText(int position)
{
if (position == -1)
{
return "";
}

String[] suffixes = new String[] { "th", "st", "nd", "rd", "th", "th", "th", "th", "th", "th" };

int remainder = position % 100;
if (remainder == 11
|| remainder == 12
|| remainder == 13)
{
//Special cases
return position + "th";
}
else
{
return position + suffixes[position%10];
}
}

public static String reverse(String str)
{
int length = str.length();
StringBuilder sb = new StringBuilder(length);

for (int i=length-1; i>=0; i--)
{
char c = str.charAt(i);
sb.append(c);
}

return sb.toString();
}

public static boolean containsNumeric(String s)
{
for (int i=0; i<s.length(); i++)
{
char c = s.charAt(i);
if (Character.isDigit(c))
{
return true;
}
}

return false;
}
}
42 changes: 8 additions & 34 deletions core/src/main/java/util/XmlUtil.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package util;

import java.io.IOException;
import java.io.StringReader;
import java.io.StringWriter;
import java.util.ArrayList;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
import org.xml.sax.InputSource;
import utils.CoreGlobals;

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
Expand All @@ -12,12 +13,9 @@
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;

import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
import org.xml.sax.InputSource;
import utils.CoreGlobals;
import java.io.IOException;
import java.io.StringReader;
import java.io.StringWriter;

public class XmlUtil
{
Expand Down Expand Up @@ -168,30 +166,6 @@ public static void setAttributeBoolean(Element rootElement, String attributeName
}
}

public static ArrayList<String> getListFromElement(Element root, String elementName, String attributePrefix)
{
ArrayList<String> ret = new ArrayList<>();

NodeList elements = root.getElementsByTagName(elementName);
if (elements.getLength() == 0)
{
Debug.append("No such element: " + elementName);
return ret;
}

Element element = (Element)elements.item(0);
int i = 0;
String card = element.getAttribute(attributePrefix + "-" + i);
while (!card.isEmpty())
{
ret.add(card);
i++;
card = element.getAttribute(attributePrefix + "-" + i);
}

return ret;
}

public static Element getElementIfExists(Element rootElement, String elementName)
{
NodeList children = rootElement.getElementsByTagName(elementName);
Expand Down
31 changes: 0 additions & 31 deletions server/src/main/java/util/PasswordServerUtil.java

This file was deleted.

0 comments on commit b2417ac

Please sign in to comment.