Package com.igormaznitsa.mvngolang.utils
Class IOUtils
java.lang.Object
com.igormaznitsa.mvngolang.utils.IOUtils
public final class IOUtils extends Object
Auxiliary class to collect methods for work with IO.
- Since:
- 2.1.7
-
Method Summary
Modifier and Type Method Description static voidcloseSilently(Closeable closeable)Close a closeable object quietly, added because such method in APACHE-IO has been deprecatedstatic StringmakeOsFilePathWithoutDuplications(File[] files)Make file path appropriate for current OS.static StringmakeOsFilePathWithoutDuplications(String... paths)Make file path from provided stringsstatic intprintTextProgressBar(String text, long value, long maxValue, int progressBarWidth, int lastValue)Print text progress bar.
-
Method Details
-
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 barvalue- value to be renderedmaxValue- max value to be renderedprogressBarWidth- width of barlastValue- 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
Close a closeable object quietly, added because such method in APACHE-IO has been deprecated- Parameters:
closeable- object to be closed
-