001/*
002 * SonarQube
003 * Copyright (C) 2009-2016 SonarSource SA
004 * mailto:contact AT sonarsource DOT com
005 *
006 * This program is free software; you can redistribute it and/or
007 * modify it under the terms of the GNU Lesser General Public
008 * License as published by the Free Software Foundation; either
009 * version 3 of the License, or (at your option) any later version.
010 *
011 * This program is distributed in the hope that it will be useful,
012 * but WITHOUT ANY WARRANTY; without even the implied warranty of
013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
014 * Lesser General Public License for more details.
015 *
016 * You should have received a copy of the GNU Lesser General Public License
017 * along with this program; if not, write to the Free Software Foundation,
018 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
019 */
020package org.sonar.api.scan.filesystem;
021
022import java.io.File;
023import java.nio.charset.Charset;
024import java.util.List;
025import javax.annotation.CheckForNull;
026import org.sonar.api.batch.BatchSide;
027import org.sonar.api.batch.fs.FileSystem;
028import org.sonar.api.batch.fs.InputFile;
029
030/**
031 * @since 3.5
032 * @deprecated in 4.2. Replaced by {@link org.sonar.api.batch.fs.FileSystem}
033 */
034@Deprecated
035@BatchSide
036public interface ModuleFileSystem {
037
038  /**
039   * Base directory.
040   */
041  File baseDir();
042
043  /**
044   * Optional directory used by the build tool to generate various kinds of data (test reports, temp files, ...).
045   * In Maven, it's given by the property ${project.build.directory}, which value is generally ${project.basedir}/target.
046   */
047  @CheckForNull
048  File buildDir();
049
050  /**
051   * Source directories.
052   * @deprecated since 4.2 use {@link FileSystem#files(org.sonar.api.batch.fs.FilePredicate)} to get all files with type {@link InputFile.Type#MAIN}.
053   */
054  List<File> sourceDirs();
055
056  /**
057   * Test directories. Non-existing directories are excluded.
058   * Example in Maven : ${project.basedir}/src/test/java
059   * @deprecated since 4.2 use {@link FileSystem#files(org.sonar.api.batch.fs.FilePredicate)} to get all files with type {@link InputFile.Type#TEST}.
060   */
061  List<File> testDirs();
062
063  /**
064   * Optional directories that contain the compiled sources, for example java bytecode.
065   * Note that :
066   * <ul>
067   * <li>Maven projects have only a single binary directory, which is generally ${project.basedir}/target/classes</li>
068   * <li>Binary directories can be empty</li>
069   * <li>Test binary directories are not supported yet.</li>
070   * </ul>
071   * @deprecated since 4.2 sonar.binaries will be converted to java specific property
072   */
073  List<File> binaryDirs();
074
075  /**
076   * Search for files. Never return null.
077   */
078  List<File> files(FileQuery query);
079
080  /**
081   * Default charset for files of the module. If it's not defined, then
082   * return the platform default charset.
083   */
084  Charset sourceCharset();
085
086  /**
087   * Working directory used by Sonar. This directory can be used for example to
088   * store intermediary reports.
089   */
090  File workingDir();
091}