Class FileIOUtils
java.lang.Object
io.jmix.flowui.devserver.frontend.FileIOUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic FileTry determining the project folder from the classpath.static booleanisProbablyTemporaryFile(File file) Checks if the given file is likely a temporary file created by an editor.static booleanwriteIfChanged(File file, String content) Writes the given content into the given file unless the file already contains that content.static booleanwriteIfChanged(File file, List<String> content) Writes the given content into the given file unless the file already contains that content.
-
Method Details
-
writeIfChanged
Writes the given content into the given file unless the file already contains that content.- Parameters:
file- the file to write tocontent- the lines to write- Returns:
- true if the content was written to the file, false otherwise
- Throws:
IOException- if something went wrong
-
writeIfChanged
Writes the given content into the given file unless the file already contains that content.- Parameters:
file- the file to write tocontent- the content to write- Returns:
- true if the content was written to the file, false otherwise
- Throws:
IOException- if something went wrong
-
getProjectFolderFromClasspath
Try determining the project folder from the classpath.- Returns:
- A file referring to the project folder or null if the folder could not be determined
-
isProbablyTemporaryFile
Checks if the given file is likely a temporary file created by an editor.- Parameters:
file- the file to check- Returns:
- true if the file is likely a temporary file, false otherwise
-