aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-deprecated/src
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-deprecated/src
parent3161c7782de577a84d85b58f9aa52861a17e082f (diff)
downloadsonarqube-c2a0f4f06564c1d62f08d4e20489f70f0f4ad223.tar.gz
sonarqube-c2a0f4f06564c1d62f08d4e20489f70f0f4ad223.zip
SONAR-3677 support deprecated FileSystemFilter
+ refactor SnapshotDataType
Diffstat (limited to 'sonar-deprecated/src')
-rw-r--r--sonar-deprecated/src/main/java/org/sonar/api/batch/FileFilter.java34
-rw-r--r--sonar-deprecated/src/main/java/org/sonar/api/scan/filesystem/FileSystemFilter.java60
2 files changed, 94 insertions, 0 deletions
diff --git a/sonar-deprecated/src/main/java/org/sonar/api/batch/FileFilter.java b/sonar-deprecated/src/main/java/org/sonar/api/batch/FileFilter.java
new file mode 100644
index 00000000000..49fd6e7a4ea
--- /dev/null
+++ b/sonar-deprecated/src/main/java/org/sonar/api/batch/FileFilter.java
@@ -0,0 +1,34 @@
+/*
+ * 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-deprecated/src/main/java/org/sonar/api/scan/filesystem/FileSystemFilter.java b/sonar-deprecated/src/main/java/org/sonar/api/scan/filesystem/FileSystemFilter.java
new file mode 100644
index 00000000000..3a215937d23
--- /dev/null
+++ b/sonar-deprecated/src/main/java/org/sonar/api/scan/filesystem/FileSystemFilter.java
@@ -0,0 +1,60 @@
+/*
+ * 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);
+}