| Type | Name and description |
|---|---|
static org.slf4j.Logger |
logger_ |
| Type Params | Return Type | Name and description |
|---|---|---|
|
static java.awt.image.BufferedImage |
convertMultiLineTextToImage(java.lang.String multiLineText)Generate a BufferedImage that shows a long path of a file in tree format so that the image has width as small as possible |
|
static java.awt.image.BufferedImage |
convertMultiLineTextToImage(java.util.List<java.lang.String> lines) |
|
static java.awt.image.BufferedImage |
convertTextToImage(java.lang.String text)creates a BufferedImage that shows the given text |
|
static int |
copyDirectory(java.nio.file.Path source, java.nio.file.Path target, boolean skipIfIdentical = true)Copies descendent files and directories recursively from the source directory into the target directory. |
|
static int |
deleteDirectory(java.nio.file.Path directory)force-delete the directory and its contents(files and directories). |
|
static void |
deleteDirectoryContents(java.nio.file.Path directory)If the specified directory exists, then delete contained files and child directories while preserving the directory undeleted. |
|
static void |
ensureDirs(java.nio.file.Path directory)utility method which creates the directory and its ancestors if not present |
|
static java.lang.String |
escapeAsJsonText(java.lang.String string)This method converts a Java string into a JSON string. |
|
static java.lang.String |
getClassShortName(java.lang.Class clazz)returns a short name of the Class stripping the package. |
|
static java.lang.String |
getTimestampAsString(java.time.LocalDateTime timestamp)utility method which stringifies a java.time.LocalDateTime object into a String of 'yyyyMMdd_HHmmss' format |
|
static java.lang.String |
now()returns the current time stamp in the format of 'yyyyMMdd_HHmmss' |
|
static java.util.List<java.lang.String> |
toTreeFormat(java.nio.file.Path path)Given a long Path, return an array of String which shows the give path in tree format. |
|
static void |
touch(java.nio.file.Path filePath)Check if a file is present or not. |
| Methods inherited from class | Name |
|---|---|
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Generate a BufferedImage that shows a long path of a file in tree format so that the image has width as small as possible
multiLineText - e.g,
"""
File not found:
C:
└─Users
└─qcq0264
└─eclipse-workspace
└─Materials
└─src
└─main
└─groovy
└─com
└─kazurayam
└─materials
└─Helpers.groovy
"""creates a BufferedImage that shows the given text see http://burnignorance.com/java-web-development-tips/converting-text-to-image-in-java-awt/
Copies descendent files and directories recursively from the source directory into the target directory.
source - a directory from which files and directories are copiedtarget - a directory into which files and directories are copiedskipExisting - default to trueforce-delete the directory and its contents(files and directories). Will say again, the specified directory will be removed! If you like to retain the directory, you should use deleteDirectoryContents(Path) method instead. If the specified directory does not exit or is not a directory, then Exception will be thrown
If the specified directory exists, then delete contained files and child directories while preserving the directory undeleted. If the specified directory does not exit, silently returns while doing nothing.
utility method which creates the directory and its ancestors if not present
This method converts a Java string into a JSON string. This method is implemented with groovy.json.StringEscapeUtils#escapeJava(String)
returns a short name of the Class stripping the package. For example, if
com.kazurayam.ksbackyard.screenshotsupport.ScreenshotRespsitoryImplis given as
clazz, then
ScreenshotRepositoryImplis returned.
utility method which stringifies a java.time.LocalDateTime object into a String of 'yyyyMMdd_HHmmss' format
returns the current time stamp in the format of 'yyyyMMdd_HHmmss'
Given a long Path, return an array of String which shows the give path in tree format.
Path - e.g, "C:\\Users\\myname\\eclipse-workspace\\Materials\\src\\main\\groovy\\com\\kazurayam\\materials\\Helpers.groovy"Check if a file is present or not. If not present, create the file of 0 bytes at the specified Path with the current timestamp. This simulate UNIX touch command for a Path