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