org.sonar.api.batch.fs
Interface InputDir

All Superinterfaces:
InputPath, Serializable
All Known Implementing Classes:
DefaultInputDir

public interface InputDir
extends InputPath

Layer over File for directories.

Since:
4.5

Method Summary
 String absolutePath()
          Normalized absolute path.
 File file()
          The underlying absolute File
 String relativePath()
          Path relative to module base directory.
 

Method Detail

relativePath

String relativePath()
Path relative to module base directory. Path is unique and identifies directory within given FileSystem. File separator is the forward slash ('/'), even on Microsoft Windows.

Returns src/main/java/com if module base dir is /path/to/module and if directory is /path/to/module/src/main/java/com.

Relative path is not null and is normalized ('foo/../foo' is replaced by 'foo').

Specified by:
relativePath in interface InputPath
See Also:
InputFile.relativePath(), relativePath()

absolutePath

String absolutePath()
Normalized absolute path. File separator is forward slash ('/'), even on Microsoft Windows.

This is not canonical path. Symbolic links are not resolved. For example if /project/src links to /tmp/src and basedir is /project, then this method returns /project/src. Use file().getCanonicalPath() to resolve symbolic link.

Specified by:
absolutePath in interface InputPath
See Also:
InputFile.absolutePath(), absolutePath()

file

File file()
The underlying absolute File

Specified by:
file in interface InputPath
See Also:
InputFile.file(), file()


Copyright © 2009–2014 SonarSource. All rights reserved.