com.atlassian.bamboo.util
Class BambooIOUtils

java.lang.Object
  extended by com.atlassian.bamboo.util.BambooIOUtils

public class BambooIOUtils
extends java.lang.Object


Field Summary
static java.nio.charset.Charset UTF_8_CHARSET
           
 
Method Summary
static boolean contentTextEquals(java.io.InputStream input1, java.io.InputStream input2, boolean trimLines)
          Perform textual comparison of contents returned by two input streams.
static boolean contentTextEquals(java.io.Reader input1, java.io.Reader input2, boolean trimLines)
          Perform textual comparison of contents returned by two readers.
static boolean isUtf8Compliant(java.io.InputStream is)
          Checks for utf8 compliance of input stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UTF_8_CHARSET

public static final java.nio.charset.Charset UTF_8_CHARSET
Method Detail

contentTextEquals

public static boolean contentTextEquals(java.io.Reader input1,
                                        java.io.Reader input2,
                                        boolean trimLines)
                                 throws java.io.IOException
Perform textual comparison of contents returned by two readers. Variation of IOUtils.contentEquals.

Parameters:
input1 - first input reader
input2 - second input reader
trimLines - flag enforcing trimming lines before comparison
Returns:
true of files are textually equal
Throws:
java.io.IOException - if an I/O error occurs

contentTextEquals

public static boolean contentTextEquals(java.io.InputStream input1,
                                        java.io.InputStream input2,
                                        boolean trimLines)
                                 throws java.io.IOException
Perform textual comparison of contents returned by two input streams. Variation of IOUtils.contentEquals.

Parameters:
input1 - first input stream
input2 - second input stream
trimLines - flag enforcing trimming lines before comparison
Returns:
true of files are textually equal
Throws:
java.io.IOException - if an I/O error occurs

isUtf8Compliant

public static boolean isUtf8Compliant(@NotNull
                                      java.io.InputStream is)
                               throws java.io.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:
java.io.IOException - in case of IO error


Copyright © 2011 Atlassian. All Rights Reserved.