aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-plugin-api
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@gmail.com>2013-10-09 21:56:05 +0200
committerSimon Brandhof <simon.brandhof@gmail.com>2013-10-09 21:56:05 +0200
commitc2a0f4f06564c1d62f08d4e20489f70f0f4ad223 (patch)
tree7d43998e7a05420ffa4562a30c41caf09f8200c9 /sonar-plugin-api
parent3161c7782de577a84d85b58f9aa52861a17e082f (diff)
downloadsonarqube-c2a0f4f06564c1d62f08d4e20489f70f0f4ad223.tar.gz
sonarqube-c2a0f4f06564c1d62f08d4e20489f70f0f4ad223.zip
SONAR-3677 support deprecated FileSystemFilter
+ refactor SnapshotDataType
Diffstat (limited to 'sonar-plugin-api')
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/batch/FileFilter.java34
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/scan/filesystem/FileSystemFilter.java60
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/scan/filesystem/InputFile.java3
3 files changed, 2 insertions, 95 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/FileFilter.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/FileFilter.java
deleted file mode 100644
index 49fd6e7a4ea..00000000000
--- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/FileFilter.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2013 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-package org.sonar.api.batch;
-
-import org.sonar.api.scan.filesystem.FileSystemFilter;
-
-import java.io.File;
-
-/**
- * @deprecated in 3.5. Replaced by {@link org.sonar.api.scan.filesystem.InputFileFilter}
- */
-@Deprecated
-public abstract class FileFilter implements java.io.FileFilter, FileSystemFilter {
- public final boolean accept(File file, FileSystemFilter.Context context) {
- return accept(file);
- }
-}
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/scan/filesystem/FileSystemFilter.java b/sonar-plugin-api/src/main/java/org/sonar/api/scan/filesystem/FileSystemFilter.java
deleted file mode 100644
index 3a215937d23..00000000000
--- a/sonar-plugin-api/src/main/java/org/sonar/api/scan/filesystem/FileSystemFilter.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * SonarQube, open source software quality management tool.
- * Copyright (C) 2008-2013 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * SonarQube is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * SonarQube is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-package org.sonar.api.scan.filesystem;
-
-import org.sonar.api.BatchExtension;
-
-import java.io.File;
-
-/**
- * Extension point to exclude some files from project scan. Some use-cases :
- * <ul>
- * <li>exclude the files that are older than x days</li>
- * <li>exclude the files which names start with Generated</li>
- * </ul>
- * @since 3.5
- * @deprecated in 4.0. Replaced by {@link InputFileFilter}.
- */
-@Deprecated
-public interface FileSystemFilter extends BatchExtension {
-
- /**
- * Plugins must not implement this interface. It is provided at runtime.
- */
- public interface Context {
- ModuleFileSystem fileSystem();
-
- FileType type();
-
- File relativeDir();
-
- /**
- * File path relative to source directory. Never return null.
- */
- String relativePath();
-
- /**
- * Absolute file path. Directory separator is slash, even on windows. Never return null.
- */
- String canonicalPath();
- }
-
- boolean accept(File file, Context context);
-}
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/scan/filesystem/InputFile.java b/sonar-plugin-api/src/main/java/org/sonar/api/scan/filesystem/InputFile.java
index c28298ef5ae..c6638353224 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/scan/filesystem/InputFile.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/scan/filesystem/InputFile.java
@@ -26,6 +26,7 @@ import org.apache.commons.lang.StringUtils;
import javax.annotation.CheckForNull;
import java.io.File;
import java.io.Serializable;
+import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -73,7 +74,7 @@ public class InputFile implements Serializable {
* // TODO provide builder ?
*/
public static InputFile create(File file, String baseRelativePath, Map<String, String> attributes) {
- Map<String,String> copy = Maps.newHashMap(attributes);
+ Map<String,String> copy = new HashMap<String, String>(attributes);
copy.put(InputFile.ATTRIBUTE_BASE_RELATIVE_PATH, baseRelativePath);
return new InputFile(file, copy);
}