Package io.quarkus.analytics.util
Class FileUtils
java.lang.Object
io.quarkus.analytics.util.FileUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidWrites a String to filestatic voidcreateFileAndParent(Path path) Creates the file for the given path and the folder that contains it.static <T> voidWrites an object, as JSON to file.static <T> Optional<T> static <T> voidWrites an object, as JSON to file
-
Constructor Details
-
FileUtils
public FileUtils()
-
-
Method Details
-
createFileAndParent
Creates the file for the given path and the folder that contains it. Does nothing if it any of those already exist.- Parameters:
path- the file to create- Throws:
IOException- if the file operation fails
-
append
Writes a String to file- Parameters:
content-path-- Throws:
IOException
-
write
Writes an object, as JSON to file- Type Parameters:
T-- Parameters:
content-path-- Throws:
IOException
-
overwrite
Writes an object, as JSON to file. Deletes previous file if it exists, before writing the new one.- Type Parameters:
T-- Parameters:
content-path-- Throws:
IOException
-
read
public static <T> Optional<T> read(Class<T> clazz, Path path, io.quarkus.devtools.messagewriter.MessageWriter log) throws IOException - Throws:
IOException
-