diff options
author | Julien HENRY <julien.henry@sonarsource.com> | 2014-11-06 09:41:02 +0100 |
---|---|---|
committer | Julien HENRY <julien.henry@sonarsource.com> | 2014-11-19 22:23:00 +0100 |
commit | 2c0723fd73baf8826cd9f804d9f604ee12e778f9 (patch) | |
tree | 8d8fa22c72787e735fbe940dacade568c62f3a33 /sonar-plugin-api | |
parent | 80734db88f7df715536e781655cddac86b03ef05 (diff) | |
download | sonarqube-2c0723fd73baf8826cd9f804d9f604ee12e778f9.tar.gz sonarqube-2c0723fd73baf8826cd9f804d9f604ee12e778f9.zip |
SONAR-5827 Feed the new "file_sources" table
Diffstat (limited to 'sonar-plugin-api')
-rw-r--r-- | sonar-plugin-api/src/main/java/org/sonar/api/batch/fs/internal/DefaultInputFile.java | 21 | ||||
-rw-r--r-- | sonar-plugin-api/src/main/java/org/sonar/api/utils/System2.java | 6 |
2 files changed, 27 insertions, 0 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/fs/internal/DefaultInputFile.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/fs/internal/DefaultInputFile.java index 6816e2f1296..a328071b25a 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/fs/internal/DefaultInputFile.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/fs/internal/DefaultInputFile.java @@ -38,6 +38,8 @@ public class DefaultInputFile implements InputFile, Serializable { private Status status; private String hash; private int lines; + private String encoding; + long[] originalLineOffsets; public DefaultInputFile(String moduleKey, String relativePath) { this.moduleKey = moduleKey; @@ -103,6 +105,14 @@ public class DefaultInputFile implements InputFile, Serializable { return moduleKey; } + public String encoding() { + return encoding; + } + + public long[] originalLineOffsets() { + return originalLineOffsets; + } + public DefaultInputFile setAbsolutePath(String s) { this.absolutePath = PathUtils.sanitize(s); return this; @@ -138,6 +148,16 @@ public class DefaultInputFile implements InputFile, Serializable { return this; } + public DefaultInputFile setEncoding(String encoding) { + this.encoding = encoding; + return this; + } + + public DefaultInputFile setOriginalLineOffsets(long[] originalLineOffsets) { + this.originalLineOffsets = originalLineOffsets; + return this; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -160,4 +180,5 @@ public class DefaultInputFile implements InputFile, Serializable { public String toString() { return "[moduleKey=" + moduleKey + ", relative=" + relativePath + ", abs=" + absolutePath + "]"; } + } diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/utils/System2.java b/sonar-plugin-api/src/main/java/org/sonar/api/utils/System2.java index bae39cb0974..81b720b7e37 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/utils/System2.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/utils/System2.java @@ -24,6 +24,8 @@ import org.sonar.api.BatchComponent; import org.sonar.api.ServerComponent; import javax.annotation.CheckForNull; + +import java.util.Date; import java.util.Map; import java.util.Properties; @@ -119,4 +121,8 @@ public class System2 implements BatchComponent, ServerComponent { public void println(String obj) { System.out.print(obj); } + + public Date newDate() { + return new Date(); + } } |