Package org.sonar.api.batch.fs.internal
Class FileMetadata
java.lang.Object
org.sonar.api.batch.fs.internal.FileMetadata
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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
computeLineHashesForIssueTracking
(org.sonar.api.batch.fs.InputFile f, FileMetadata.LineHashConsumer consumer) Compute a MD5 hash of each line of the file after removing of all blank charsstatic void
readFile
(InputStream stream, Charset encoding, String filePath, CharHandler[] handlers) readMetadata
(InputStream stream, Charset encoding, String filePath) readMetadata
(InputStream stream, Charset encoding, String filePath, CharHandler otherHandler) Compute hash of a file ignoring line ends differences.readMetadata
(Reader reader) For testing purpose
-
Constructor Details
-
FileMetadata
public FileMetadata(org.sonar.api.notifications.AnalysisWarnings analysisWarnings)
-
-
Method Details
-
readMetadata
public Metadata readMetadata(InputStream stream, Charset encoding, String filePath, @Nullable CharHandler otherHandler) Compute hash of a file ignoring line ends differences. Maximum performance is needed. -
readMetadata
-
readMetadata
For testing purpose -
readFile
public static void readFile(InputStream stream, Charset encoding, String filePath, CharHandler[] handlers) -
computeLineHashesForIssueTracking
public static void computeLineHashesForIssueTracking(org.sonar.api.batch.fs.InputFile f, FileMetadata.LineHashConsumer consumer) Compute a MD5 hash of each line of the file after removing of all blank chars
-