Package org.sonar.api.batch.fs.internal
Class FileMetadata
- java.lang.Object
-
- org.sonar.api.batch.fs.internal.FileMetadata
-
@Immutable public class FileMetadata extends java.lang.Object
Computes hash of files. Ends of Lines are ignored, so files with same content but different EOL encoding have the same hash.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
FileMetadata.LineHashConsumer
-
Constructor Summary
Constructors Constructor Description FileMetadata()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
computeLineHashesForIssueTracking(InputFile f, FileMetadata.LineHashConsumer consumer)
Compute a MD5 hash of each line of the file after removing of all blank charsstatic void
readFile(java.io.InputStream stream, java.nio.charset.Charset encoding, java.lang.String filePath, CharHandler[] handlers)
Metadata
readMetadata(java.io.InputStream stream, java.nio.charset.Charset encoding, java.lang.String filePath)
Metadata
readMetadata(java.io.InputStream stream, java.nio.charset.Charset encoding, java.lang.String filePath, CharHandler otherHandler)
Compute hash of a file ignoring line ends differences.Metadata
readMetadata(java.io.Reader reader)
For testing purpose
-
-
-
Method Detail
-
readMetadata
public Metadata readMetadata(java.io.InputStream stream, java.nio.charset.Charset encoding, java.lang.String filePath, @Nullable CharHandler otherHandler)
Compute hash of a file ignoring line ends differences. Maximum performance is needed.
-
readMetadata
public Metadata readMetadata(java.io.InputStream stream, java.nio.charset.Charset encoding, java.lang.String filePath)
-
readMetadata
public Metadata readMetadata(java.io.Reader reader)
For testing purpose
-
readFile
public static void readFile(java.io.InputStream stream, java.nio.charset.Charset encoding, java.lang.String filePath, CharHandler[] handlers)
-
computeLineHashesForIssueTracking
public static void computeLineHashesForIssueTracking(InputFile f, FileMetadata.LineHashConsumer consumer)
Compute a MD5 hash of each line of the file after removing of all blank chars
-
-