Package io.micronaut.core.io
Class IOUtils
java.lang.Object
io.micronaut.core.io.IOUtils
Utility methods for I/O operations.
- Since:
- 1.0
- Author:
- Graeme Rocher
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
Iterates over each directory in a JAR or file system.static void
Iterates over each directory in a JAR or file system.static String
readText
(BufferedReader reader) Read the content of the BufferedReader and return it as a String in a blocking manner.
-
Constructor Details
-
IOUtils
public IOUtils()
-
-
Method Details
-
eachFile
public static void eachFile(@NonNull @NonNull URL url, String path, @NonNull @NonNull Consumer<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 @NonNull URI uri, String path, @NonNull @NonNull Consumer<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
Read 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:
IOException
- if an IOException occurs.- Since:
- 1.0
-