Package com.atlassian.bamboo.util
Class BambooIOUtils
- java.lang.Object
-
- com.atlassian.bamboo.util.BambooIOUtils
-
public class BambooIOUtils extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static Charset
UTF_8_CHARSET
Deprecated.since 5.15 useStandardCharsets
instead
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
contentTextEquals(InputStream input1, InputStream input2, boolean trimLines)
Perform textual comparison of contents returned by two input streams.static boolean
contentTextEquals(Reader input1, Reader input2, boolean trimLines)
Perform textual comparison of contents returned by two readers.static void
copy(InputStream inputStream, OutputStream outputStream)
static void
copyWithRuntimeExceptionThrowing(InputStream inputStream, OutputStream outputStream)
Copy input stream to output stream, closing streams when finished.static boolean
isUtf8Compliant(@NotNull InputStream is)
Checks for utf8 compliance of input stream.
-
-
-
Field Detail
-
UTF_8_CHARSET
@Deprecated public static final Charset UTF_8_CHARSET
Deprecated.since 5.15 useStandardCharsets
instead
-
-
Method Detail
-
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
public static boolean isUtf8Compliant(@NotNull @NotNull InputStream is) throws IOException
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
public static void copy(InputStream inputStream, OutputStream outputStream) throws IOException
- 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.
-
-