Package org.sentrysoftware.maven.skin
Class Helper
java.lang.Object
org.sentrysoftware.maven.skin.Helper
Utility class with various static helper functions.
-
Method Summary
Modifier and TypeMethodDescriptionstatic long
getLastModifiedTime
(File file) Returns the time of last modification of specified File in milliseconds since EPOCH.static long
getLastModifiedTime
(String filePathString) Returns the time of last modification of specified file in milliseconds since EPOCH.static long
getLastModifiedTime
(Path path) Returns the time of last modification of specified Path in milliseconds since EPOCH.static String
readResourceAsString
(String resourcePath) Reads the content of a resource file and returns it as a String.static void
Write a text file using System.lineSeparator()
-
Method Details
-
writeText
Write a text file using System.lineSeparator()- Parameters:
file
- The file instance to write totext
- The text to writecharset
- The charset to use when writing text- Throws:
IOException
- when anything goes wrong
-
getLastModifiedTime
Returns the time of last modification of specified Path in milliseconds since EPOCH.- Parameters:
path
- Path to the file- Returns:
- Milliseconds since EPOCH, or 0 (zero) if file does not exist
-
getLastModifiedTime
Returns the time of last modification of specified File in milliseconds since EPOCH.- Parameters:
file
- File instance- Returns:
- Milliseconds since EPOCH, or 0 (zero) if file does not exist
-
getLastModifiedTime
Returns the time of last modification of specified file in milliseconds since EPOCH.- Parameters:
filePathString
- Path to the file (as a String)- Returns:
- Milliseconds since EPOCH, or 0 (zero) if file does not exist
-
readResourceAsString
Reads the content of a resource file and returns it as a String.- Parameters:
resourcePath
- The path to the resource file- Returns:
- The content of the resource file as a String
- Throws:
IOException
- If an I/O error occurs
-