Class IOUtils


  • public class IOUtils
    extends java.lang.Object
    Utility 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 void eachFile​(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 void eachFile​(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.String readText​(java.io.BufferedReader reader)
      Read the content of the BufferedReader and return it as a String in a blocking manner.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • IOUtils

        public IOUtils()
    • 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 URL
        path - The path
        consumer - 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 URI
        path - The path
        consumer - The consumer
        Since:
        3.5.0
      • readText

        public static java.lang.String readText​(java.io.BufferedReader reader)
                                         throws java.io.IOException
        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:
        java.io.IOException - if an IOException occurs.
        Since:
        1.0