org.sonar.api.resources
Class DefaultProjectFileSystem

java.lang.Object
  extended by org.sonar.api.resources.DefaultProjectFileSystem
All Implemented Interfaces:
BatchComponent, ProjectFileSystem

Deprecated. in 2.8. In fact this class should not be located in sonar-plugin-api and most of the methods were overridden by a component in sonar-batch.

@Deprecated
public class DefaultProjectFileSystem
extends Object
implements ProjectFileSystem

An implementation of ProjectFileSystem. For internal use only.

Since:
1.10

Field Summary
protected static com.google.common.base.Predicate<File> DIRECTORY_EXISTS
          Deprecated.  
 
Constructor Summary
DefaultProjectFileSystem(Project project, Languages languages)
          Deprecated.  
DefaultProjectFileSystem(Project project, Languages languages, FileFilter... fileFilters)
          Deprecated.  
 
Method Summary
 DefaultProjectFileSystem addSourceDir(File dir)
          Deprecated. since 2.6, because should be immutable
 DefaultProjectFileSystem addTestDir(File dir)
          Deprecated. since 2.6, because should be immutable
 File getBasedir()
          Deprecated. Project root directory.
 File getBuildDir()
          Deprecated. Build directory.
 File getBuildOutputDir()
          Deprecated. Directory where classes are placed.
 File getFileFromBuildDirectory(String filename)
          Deprecated.  
 List<File> getJavaSourceFiles()
          Deprecated. 
static String getRelativePath(File file, File dir)
          Deprecated. getRelativePath("c:/foo/src/my/package/Hello.java", "c:/foo/src") is "my/package/Hello.java"
static String getRelativePath(File file, List<File> dirs)
          Deprecated. getRelativePath("c:/foo/src/my/package/Hello.java", ["c:/bar", "c:/foo/src"]) is "my/package/Hello.java".
 File getReportOutputDir()
          Deprecated.  
 File getSonarWorkingDirectory()
          Deprecated.  
 Charset getSourceCharset()
          Deprecated. Source encoding.
 List<File> getSourceDirs()
          Deprecated. Maven can modify source directories during Sonar execution - see MavenPhaseExecutor.
 List<File> getSourceFiles(Language... langs)
          Deprecated. 
 List<File> getTestDirs()
          Deprecated. Maven can modify test directories during Sonar execution - see MavenPhaseExecutor.
 List<File> getTestFiles(Language... langs)
          Deprecated. 
 boolean hasJavaSourceFiles()
          Deprecated. Check if the project has Java files, excluding unit tests and files matching project exclusion patterns.
 boolean hasTestFiles(Language lang)
          Deprecated. 
 List<InputFile> mainFiles(String... langs)
          Deprecated. Source files, excluding unit tests and files matching project exclusion patterns.
 File resolvePath(String path)
          Deprecated.  
protected  List<File> resolvePaths(List<String> paths)
          Deprecated.  
 List<InputFile> testFiles(String... langs)
          Deprecated. Source files of unit tests.
 Resource toResource(File file)
          Deprecated.  
protected static File writeToFile(String content, File dir, String fileName)
          Deprecated.  
 File writeToWorkingDirectory(String content, String fileName)
          Deprecated. Save data into a new file of Sonar working directory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DIRECTORY_EXISTS

protected static final com.google.common.base.Predicate<File> DIRECTORY_EXISTS
Deprecated. 
Constructor Detail

DefaultProjectFileSystem

public DefaultProjectFileSystem(Project project,
                                Languages languages)
Deprecated. 

DefaultProjectFileSystem

public DefaultProjectFileSystem(Project project,
                                Languages languages,
                                FileFilter... fileFilters)
Deprecated. 
Method Detail

getSourceCharset

public Charset getSourceCharset()
Deprecated. 
Description copied from interface: ProjectFileSystem
Source encoding. Never null, it returns the default platform charset if it is not defined in project. (Maven property 'project.build.sourceEncoding').

Specified by:
getSourceCharset in interface ProjectFileSystem

getBasedir

public File getBasedir()
Deprecated. 
Description copied from interface: ProjectFileSystem
Project root directory.

Specified by:
getBasedir in interface ProjectFileSystem

getBuildDir

public File getBuildDir()
Deprecated. 
Description copied from interface: ProjectFileSystem
Build directory. It's "${basedir}/target" by default in Maven projects.

Specified by:
getBuildDir in interface ProjectFileSystem

getBuildOutputDir

public File getBuildOutputDir()
Deprecated. 
Description copied from interface: ProjectFileSystem
Directory where classes are placed. It's "${basedir}/target/classes" by default in Maven projects.

Specified by:
getBuildOutputDir in interface ProjectFileSystem

getSourceDirs

public List<File> getSourceDirs()
Deprecated. 
Maven can modify source directories during Sonar execution - see MavenPhaseExecutor.

Specified by:
getSourceDirs in interface ProjectFileSystem

addSourceDir

@Deprecated
public DefaultProjectFileSystem addSourceDir(File dir)
Deprecated. since 2.6, because should be immutable

Description copied from interface: ProjectFileSystem
Adds a source directory

Specified by:
addSourceDir in interface ProjectFileSystem
Returns:
the current object

getTestDirs

public List<File> getTestDirs()
Deprecated. 
Maven can modify test directories during Sonar execution - see MavenPhaseExecutor.

Specified by:
getTestDirs in interface ProjectFileSystem

addTestDir

@Deprecated
public DefaultProjectFileSystem addTestDir(File dir)
Deprecated. since 2.6, because should be immutable

Description copied from interface: ProjectFileSystem
Adds a test directory

Specified by:
addTestDir in interface ProjectFileSystem
Returns:
the current object

getReportOutputDir

public File getReportOutputDir()
Deprecated. 
Specified by:
getReportOutputDir in interface ProjectFileSystem
Returns:
the directory where reporting is placed. Default is target/sites

getSonarWorkingDirectory

public File getSonarWorkingDirectory()
Deprecated. 
Specified by:
getSonarWorkingDirectory in interface ProjectFileSystem
Returns:
the Sonar working directory. Default is "target/sonar"

resolvePath

public File resolvePath(String path)
Deprecated. 
Specified by:
resolvePath in interface ProjectFileSystem
Returns:
file in canonical form from specified path. Path can be absolute or relative to project basedir. For example resolvePath("pom.xml") or resolvePath("src/main/java")

resolvePaths

protected List<File> resolvePaths(List<String> paths)
Deprecated. 

getSourceFiles

@Deprecated
public List<File> getSourceFiles(Language... langs)
Deprecated. 

Description copied from interface: ProjectFileSystem
Source files, excluding unit tests and files matching project exclusion patterns.

Specified by:
getSourceFiles in interface ProjectFileSystem
Parameters:
langs - language filter. Check all files, whatever their language, if null or empty.

getJavaSourceFiles

@Deprecated
public List<File> getJavaSourceFiles()
Deprecated. 

Description copied from interface: ProjectFileSystem
Java source files, excluding unit tests and files matching project exclusion patterns. Shortcut for getSourceFiles(Java.INSTANCE)

Specified by:
getJavaSourceFiles in interface ProjectFileSystem

hasJavaSourceFiles

public boolean hasJavaSourceFiles()
Deprecated. 
Description copied from interface: ProjectFileSystem
Check if the project has Java files, excluding unit tests and files matching project exclusion patterns.

Specified by:
hasJavaSourceFiles in interface ProjectFileSystem

getTestFiles

@Deprecated
public List<File> getTestFiles(Language... langs)
Deprecated. 

Description copied from interface: ProjectFileSystem
Unit test files, excluding files matching project exclusion patterns.

Specified by:
getTestFiles in interface ProjectFileSystem

hasTestFiles

@Deprecated
public boolean hasTestFiles(Language lang)
Deprecated. 

Description copied from interface: ProjectFileSystem
Check if the project has unit test files, excluding files matching project exclusion patterns.

Specified by:
hasTestFiles in interface ProjectFileSystem

writeToWorkingDirectory

public File writeToWorkingDirectory(String content,
                                    String fileName)
                             throws IOException
Deprecated. 
Description copied from interface: ProjectFileSystem
Save data into a new file of Sonar working directory.

Specified by:
writeToWorkingDirectory in interface ProjectFileSystem
Returns:
the created file
Throws:
IOException

writeToFile

protected static File writeToFile(String content,
                                  File dir,
                                  String fileName)
                           throws IOException
Deprecated. 
Throws:
IOException

getRelativePath

public static String getRelativePath(File file,
                                     File dir)
Deprecated. 
getRelativePath("c:/foo/src/my/package/Hello.java", "c:/foo/src") is "my/package/Hello.java"

Returns:
null if file is not in dir (including recursive subdirectories)

getRelativePath

public static String getRelativePath(File file,
                                     List<File> dirs)
Deprecated. 
getRelativePath("c:/foo/src/my/package/Hello.java", ["c:/bar", "c:/foo/src"]) is "my/package/Hello.java".

Relative path is composed of slashes. Windows backslaches are replaced by /

Returns:
null if file is not in dir (including recursive subdirectories)

getFileFromBuildDirectory

public File getFileFromBuildDirectory(String filename)
Deprecated. 
Specified by:
getFileFromBuildDirectory in interface ProjectFileSystem

toResource

public Resource toResource(File file)
Deprecated. 
Specified by:
toResource in interface ProjectFileSystem

mainFiles

public List<InputFile> mainFiles(String... langs)
Deprecated. 
Description copied from interface: ProjectFileSystem
Source files, excluding unit tests and files matching project exclusion patterns.

Specified by:
mainFiles in interface ProjectFileSystem
Parameters:
langs - language filter. If null or empty, will return empty list
Since:
2.6

testFiles

public List<InputFile> testFiles(String... langs)
Deprecated. 
Description copied from interface: ProjectFileSystem
Source files of unit tests. Exclusion patterns are not applied.

Specified by:
testFiles in interface ProjectFileSystem
Parameters:
langs - language filter. If null or empty, will return empty list
Since:
2.6


Copyright © 2009-2011 SonarSource. All Rights Reserved.