001/*
002 * SonarQube, open source software quality management tool.
003 * Copyright (C) 2008-2014 SonarSource
004 * mailto:contact AT sonarsource DOT com
005 *
006 * SonarQube 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 * SonarQube 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 org.sonar.api.BatchComponent;
023import org.sonar.api.batch.fs.FileSystem;
024import org.sonar.api.batch.fs.InputFile;
025
026import javax.annotation.CheckForNull;
027
028import java.io.File;
029import java.nio.charset.Charset;
030import java.util.List;
031
032/**
033 * @since 3.5
034 * @deprecated in 4.2. Replaced by {@link org.sonar.api.batch.fs.FileSystem}
035 */
036@Deprecated
037public interface ModuleFileSystem extends BatchComponent {
038
039  /**
040   * Base directory.
041   */
042  File baseDir();
043
044  /**
045   * Optional directory used by the build tool to generate various kinds of data (test reports, temp files, ...).
046   * In Maven, it's given by the property ${project.build.directory}, which value is generally ${project.basedir}/target.
047   */
048  @CheckForNull
049  File buildDir();
050
051  /**
052   * Source directories.
053   * @deprecated since 4.2 use {@link FileSystem#files(org.sonar.api.batch.fs.FilePredicate)} to get all files with type {@link InputFile.Type#MAIN}.
054   */
055  List<File> sourceDirs();
056
057  /**
058   * Test directories. Non-existing directories are excluded.
059   * Example in Maven : ${project.basedir}/src/test/java
060   * @deprecated since 4.2 use {@link FileSystem#files(org.sonar.api.batch.fs.FilePredicate)} to get all files with type {@link InputFile.Type#TEST}.
061   */
062  List<File> testDirs();
063
064  /**
065   * Optional directories that contain the compiled sources, for example java bytecode.
066   * Note that :
067   * <ul>
068   * <li>Maven projects have only a single binary directory, which is generally ${project.basedir}/target/classes</li>
069   * <li>Binary directories can be empty</li>
070   * <li>Test binary directories are not supported yet.</li>
071   * </ul>
072   * @deprecated since 4.2 sonar.binaries will be converted to java specific property
073   */
074  List<File> binaryDirs();
075
076  /**
077   * Search for files. Never return null.
078   */
079  List<File> files(FileQuery query);
080
081  /**
082   * Default charset for files of the module. If it's not defined, then
083   * return the platform default charset. When trying to read an input file it is better to rely on
084   * {@link InputFile#encoding()} as encoding may be different for each file.
085   */
086  Charset sourceCharset();
087
088  /**
089   * Working directory used by Sonar. This directory can be used for example to
090   * store intermediary reports.
091   */
092  File workingDir();
093}