Package com.github.rhys_h_walker.misc
Class Utilities
java.lang.Object
com.github.rhys_h_walker.misc.Utilities
A class of general purpose utilities
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
cleanFileNameString
(String filename) Clean a non empty String for use as a filename REGEX USED = INVALID_FILENAME_CHARS_REGEX *Check Utilities.java* Trailing dots and spaces removed File name size limit imposed 100 chars On error no alternative name will be givenstatic String
formatFilepathFromTimestamp
(LocalDateTime ts, File applicationDirectory) Create a path from a timestamp and app directorystatic String
removeLeadingZeros
(String toRemove) Remove all leading zeros from a String
-
Method Details
-
removeLeadingZeros
Remove all leading zeros from a String- Parameters:
toRemove
- The String to have zeros removed- Returns:
- The String without zeros
-
formatFilepathFromTimestamp
Create a path from a timestamp and app directory- Parameters:
ts
- Timestamp to format fileString fromapplicationDirectory
- The directory to begin searching from- Returns:
- String representing the path to a .log file
-
cleanFileNameString
Clean a non empty String for use as a filename REGEX USED = INVALID_FILENAME_CHARS_REGEX *Check Utilities.java* Trailing dots and spaces removed File name size limit imposed 100 chars On error no alternative name will be given- Parameters:
filename
- The filename to clean- Returns:
- A cleaned version/null if errored
-