Class IOUtils

java.lang.Object
io.micronaut.core.io.IOUtils

public class IOUtils extends Object
Utility methods for I/O operations.
Since:
1.0
Author:
Graeme Rocher
  • 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 URL
      path - The path
      consumer - 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 URI
      path - The path
      consumer - The consumer
      Since:
      3.5.0
    • readText

      public static String readText(BufferedReader reader) throws IOException
      Read the content of the BufferedReader and return it as a String in a blocking manner. The BufferedReader is closed afterward.
      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