Package net.minheur.potoflux
Class Functions
java.lang.Object
net.minheur.potoflux.Functions
This class stores useful methods for all potoflux.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanOpens a directory in your file explorerstatic StringescapeHtml(String s) Method to remove characters used in HTML code from aStringstatic voidThis method is used to call exiting with a delay.static StringformatMessage(String message, Object... args) Format a message with placeholders.listResourceFiles(String folder) Deprecated.static booleanSimply opens a given file dir in the explorer.static LocalDateTimeparseSqlDate(String timestamp) static StringMethod to remove all characters that could be dangerous in aStringinputted by the user
-
Constructor Details
-
Functions
public Functions()
-
-
Method Details
-
exit
This method is used to call exiting with a delay.- Parameters:
delay- amount of milliseconds before exitingstatus- exit code
-
parseSqlDate
-
removeProhibitedChar
Method to remove all characters that could be dangerous in aStringinputted by the user- Parameters:
s- the String to check- Returns:
- the checked String
-
escapeHtml
Method to remove characters used in HTML code from aString- Parameters:
s- the String to check- Returns:
- the checked String
-
listResourceFiles
@Deprecated(since="6.4") public static List<String> listResourceFiles(String folder) throws IOException Deprecated.Method to get a list of .txt file names from a folder in the resources path- Parameters:
folder- the dir to get files from- Returns:
- a list of file names
- Throws:
IOException- if the folder couldn't get accessed
-
formatMessage
Format a message with placeholders.- Parameters:
message- your initial message. Use $$ and an int to set your placeholdersargs- your placeholder's values. the first one is $$1, then $$2...- Returns:
- the formated message
-
browse
Opens a directory in your file explorer- Parameters:
url- directory to open- Returns:
- weather the directory got opened or if an error happened
-
openDir
Simply opens a given file dir in the explorer. Handles exception.- Parameters:
dir- file to open- Returns:
- weather the file go opened
-