Package com.atlassian.bamboo.util
Class BambooIOUtils
java.lang.Object
com.atlassian.bamboo.util.BambooIOUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleancontentTextEquals(InputStream input1, InputStream input2, boolean trimLines) Perform textual comparison of contents returned by two input streams.static booleancontentTextEquals(Reader input1, Reader input2, boolean trimLines) Perform textual comparison of contents returned by two readers.static voidcopy(InputStream inputStream, OutputStream outputStream) static voidcopyWithRuntimeExceptionThrowing(InputStream inputStream, OutputStream outputStream) Copy input stream to output stream, closing streams when finished.static booleanisUtf8Compliant(@NotNull InputStream is) Checks for utf8 compliance of input stream.
-
Method Details
-
contentTextEquals
public static boolean contentTextEquals(Reader input1, Reader input2, boolean trimLines) throws IOException Perform textual comparison of contents returned by two readers. Variation of IOUtils.contentEquals.- Parameters:
input1- first input readerinput2- second input readertrimLines- flag enforcing trimming lines before comparison- Returns:
- true of files are textually equal
- Throws:
IOException- if an I/O error occurs
-
contentTextEquals
public static boolean contentTextEquals(InputStream input1, InputStream input2, boolean trimLines) throws IOException Perform textual comparison of contents returned by two input streams. Variation of IOUtils.contentEquals.- Parameters:
input1- first input streaminput2- second input streamtrimLines- flag enforcing trimming lines before comparison- Returns:
- true of files are textually equal
- Throws:
IOException- if an I/O error occurs
-
isUtf8Compliant
Checks for utf8 compliance of input stream. Does not preserve stream state and closes stream at the end.- Parameters:
is- the input stream to check for utf8 compliance. Does not need to (should not) be buffered.- Returns:
- true if stream is compliant
- Throws:
IOException- in case of IO error
-
copy
- Throws:
IOException
-
copyWithRuntimeExceptionThrowing
public static void copyWithRuntimeExceptionThrowing(InputStream inputStream, OutputStream outputStream) Copy input stream to output stream, closing streams when finished. Rethrowing Exception as RuntimeException. To be used in Runnable/Callable etc.
-