Atavism Version 2018.1AGIS API

atavism.agis.util
Class HelperFunctions

java.lang.Object
  extended by atavism.agis.util.HelperFunctions

public class HelperFunctions
extends java.lang.Object

A collection of useful functions such as string checkers, form senders and file copiers.

Author:
Andrew

Constructor Summary
HelperFunctions()
           
 
Method Summary
static boolean CopyTemplateFiles(java.lang.String templateName, java.lang.String islandName)
          Copies the templates files into a new folder for the island a player is creating.
static boolean isAlphaNumeric(java.lang.String s)
          Checks whether the passed in string is alphanumeric.
static boolean isAlphaNumericWithSpaces(java.lang.String s)
          Checks whether the passed in string contains only letters, numbers, and spaces.
static boolean isAlphaNumericWithSpacesAndApostrophes(java.lang.String s)
          Checks whether the passed in string contains only letters, numbers, spaces and apostrophes.
static java.lang.String readEncodedString(byte[] bytes)
          Converts a UTF-8 encoded string presented as an array of bytes into a String object.
static void sendHtmlForm(java.lang.String url, java.util.HashMap<java.lang.String,java.lang.String> data)
          Sends out an HTML form with the data provided to the file provided.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HelperFunctions

public HelperFunctions()
Method Detail

isAlphaNumeric

public static boolean isAlphaNumeric(java.lang.String s)
Checks whether the passed in string is alphanumeric.

Parameters:
s -
Returns:

isAlphaNumericWithSpaces

public static boolean isAlphaNumericWithSpaces(java.lang.String s)
Checks whether the passed in string contains only letters, numbers, and spaces.

Parameters:
s -
Returns:

isAlphaNumericWithSpacesAndApostrophes

public static boolean isAlphaNumericWithSpacesAndApostrophes(java.lang.String s)
Checks whether the passed in string contains only letters, numbers, spaces and apostrophes.

Parameters:
s -
Returns:

readEncodedString

public static java.lang.String readEncodedString(byte[] bytes)
Converts a UTF-8 encoded string presented as an array of bytes into a String object. Needed to read in UTF-8 encoded strings from MySQL.

Parameters:
bytes -
Returns:

sendHtmlForm

public static void sendHtmlForm(java.lang.String url,
                                java.util.HashMap<java.lang.String,java.lang.String> data)
Sends out an HTML form with the data provided to the file provided. Used to copy the template files to a new island folder when a player creates a new island.

Parameters:
url -
data -

CopyTemplateFiles

public static boolean CopyTemplateFiles(java.lang.String templateName,
                                        java.lang.String islandName)
Copies the templates files into a new folder for the island a player is creating.

Parameters:
templateName -
islandName -
Returns:


Copyright © 2018 Dragonsan Studios Sp. z o.o.