Package io.micronaut.core.io
Class IOUtils
- java.lang.Object
-
- io.micronaut.core.io.IOUtils
-
public class IOUtils extends java.lang.ObjectUtility methods for I/O operations.- Since:
- 1.0
-
-
Constructor Summary
Constructors Constructor Description IOUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voideachFile(java.net.URI uri, java.lang.String path, java.util.function.Consumer<java.nio.file.Path> consumer)Iterates over each directory in a JAR or file system.static voideachFile(java.net.URL url, java.lang.String path, java.util.function.Consumer<java.nio.file.Path> consumer)Iterates over each directory in a JAR or file system.static java.lang.StringreadText(java.io.BufferedReader reader)Read the content of the BufferedReader and return it as a String in a blocking manner.
-
-
-
Method Detail
-
eachFile
public static void eachFile(@NonNull java.net.URL url, java.lang.String path, @NonNull java.util.function.Consumer<java.nio.file.Path> consumer)
Iterates over each directory in a JAR or file system.- Parameters:
url- The URLpath- The pathconsumer- The consumer- Since:
- 3.5.0
-
eachFile
public static void eachFile(@NonNull java.net.URI uri, java.lang.String path, @NonNull java.util.function.Consumer<java.nio.file.Path> consumer)
Iterates over each directory in a JAR or file system.- Parameters:
uri- The URIpath- The pathconsumer- The consumer- Since:
- 3.5.0
-
readText
public static java.lang.String readText(java.io.BufferedReader reader) throws java.io.IOExceptionRead the content of the BufferedReader and return it as a String in a blocking manner. The BufferedReader is closed afterwards.- Parameters:
reader- a BufferedReader whose content we want to read- Returns:
- a String containing the content of the buffered reader
- Throws:
java.io.IOException- if an IOException occurs.- Since:
- 1.0
-
-