aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-runner-api/src/main/java/org/sonar/runner/api/Utils.java
diff options
context:
space:
mode:
Diffstat (limited to 'sonar-runner-api/src/main/java/org/sonar/runner/api/Utils.java')
-rw-r--r--sonar-runner-api/src/main/java/org/sonar/runner/api/Utils.java12
1 files changed, 11 insertions, 1 deletions
diff --git a/sonar-runner-api/src/main/java/org/sonar/runner/api/Utils.java b/sonar-runner-api/src/main/java/org/sonar/runner/api/Utils.java
index 4d0524a..4d4907a 100644
--- a/sonar-runner-api/src/main/java/org/sonar/runner/api/Utils.java
+++ b/sonar-runner-api/src/main/java/org/sonar/runner/api/Utils.java
@@ -33,12 +33,22 @@ import java.nio.file.SimpleFileVisitor;
import java.util.Arrays;
import java.util.Iterator;
import java.util.Properties;
-import java.nio.file.attribute.*;
+import java.nio.file.attribute.BasicFileAttributes;
class Utils {
private Utils() {
// only util static methods
}
+
+ static boolean isAtLeast52(String version) {
+ //it can be snapshot (5.2-SNAPSHOT)
+ if(version == null) {
+ return false;
+ }
+
+ int endIndex = Math.min(3, version.length());
+ return Double.parseDouble(version.substring(0, endIndex)) >= 5.2;
+ }
/**
* Similar to org.apache.commons.lang.StringUtils#join()