aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-plugin-api
diff options
context:
space:
mode:
authorJulien HENRY <julien.henry@sonarsource.com>2017-09-07 16:53:53 +0200
committerJulien HENRY <julien.henry@sonarsource.com>2017-09-15 08:51:08 +0200
commitd7f6b43479809e01af8d0ebeda96cc0ed2520d31 (patch)
tree8a843155ebd5aa646eb2c186853436e7228f2cc2 /sonar-plugin-api
parent2ec01b5375b038baae335785a2622c439de2d399 (diff)
downloadsonarqube-d7f6b43479809e01af8d0ebeda96cc0ed2520d31.tar.gz
sonarqube-d7f6b43479809e01af8d0ebeda96cc0ed2520d31.zip
SONAR-9646 Deprecate support of absolute file patterns (file:xxx)
Diffstat (limited to 'sonar-plugin-api')
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/batch/fs/internal/PathPattern.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/fs/internal/PathPattern.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/fs/internal/PathPattern.java
index d91829c5404..db86e6d0242 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/fs/internal/PathPattern.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/fs/internal/PathPattern.java
@@ -25,10 +25,18 @@ import org.apache.commons.io.FilenameUtils;
import org.apache.commons.lang.StringUtils;
import org.sonar.api.utils.PathUtils;
import org.sonar.api.utils.WildcardPattern;
+import org.sonar.api.utils.log.Logger;
+import org.sonar.api.utils.log.Loggers;
@ThreadSafe
public abstract class PathPattern {
+ private static final Logger LOG = Loggers.get(PathPattern.class);
+
+ /**
+ * @deprecated since 6.6
+ */
+ @Deprecated
private static final String ABSOLUTE_PATH_PATTERN_PREFIX = "file:";
final WildcardPattern pattern;
@@ -43,6 +51,7 @@ public abstract class PathPattern {
public static PathPattern create(String s) {
String trimmed = StringUtils.trim(s);
if (StringUtils.startsWithIgnoreCase(trimmed, ABSOLUTE_PATH_PATTERN_PREFIX)) {
+ LOG.warn("Using absolute path pattern is deprecated. Please use relative path instead of '" + trimmed + "'");
return new AbsolutePathPattern(StringUtils.substring(trimmed, ABSOLUTE_PATH_PATTERN_PREFIX.length()));
}
return new RelativePathPattern(trimmed);
@@ -56,6 +65,10 @@ public abstract class PathPattern {
return result;
}
+ /**
+ * @deprecated since 6.6
+ */
+ @Deprecated
private static class AbsolutePathPattern extends PathPattern {
private AbsolutePathPattern(String pattern) {
super(pattern);