Class IOUtils


  • public final class IOUtils
    extends Object
    Auxiliary class to collect methods for work with IO.
    Since:
    2.1.7
    • Method Detail

      • printTextProgressBar

        public static int printTextProgressBar​(@Nonnull
                                               String text,
                                               long value,
                                               long maxValue,
                                               int progressBarWidth,
                                               int lastValue)
        Print text progress bar.
        Parameters:
        text - title of the bar
        value - value to be rendered
        maxValue - max value to be rendered
        progressBarWidth - width of bar
        lastValue - value which was rendered last time, if the same then it will not be rendered
        Returns:
        rendered value
        Since:
        2.3.0
      • makeOsFilePathWithoutDuplications

        @Nonnull
        public static String makeOsFilePathWithoutDuplications​(@Nonnull @MayContainNull
                                                               File[] files)
        Make file path appropriate for current OS.
        Parameters:
        files - files which will be added in the path
        Returns:
        joined file path with OS file separator
        Since:
        2.1.7
      • makeOsFilePathWithoutDuplications

        @Nonnull
        public static String makeOsFilePathWithoutDuplications​(@Nonnull @MayContainNull
                                                               String... paths)
        Make file path from provided strings
        Parameters:
        paths - path elements
        Returns:
        joined file path with OS file separator
        Since:
        2.1.7
      • closeSilently

        public static void closeSilently​(@Nullable
                                         Closeable closeable)
        Close a closeable object quietly, added because such method in APACHE-IO has been deprecated
        Parameters:
        closeable - object to be closed