|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.sonar.api.batch.fs.internal.DefaultInputFile
public class DefaultInputFile
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.sonar.api.batch.fs.InputFile |
---|
InputFile.Status, InputFile.Type |
Constructor Summary | |
---|---|
DefaultInputFile(String relativePath)
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public DefaultInputFile(String relativePath)
Method Detail |
---|
public String relativePath()
InputFile
FileSystem
. File separator is the forward
slash ('/'), even on Microsoft Windows.
Returns src/main/java/com/Foo.java
if module base dir is
/path/to/module
and if file is
/path/to/module/src/main/java/com/Foo.java
.
Relative path is not null and is normalized ('foo/../foo' is replaced by 'foo').
@CheckForNull public String absolutePath()
setFile(java.io.File)
previously.
public File file()
InputFile
File
@CheckForNull public String language()
setLanguage(String)
previously.
public InputFile.Type type()
InputFile
@CheckForNull public InputFile.Status status()
setStatus(org.sonar.api.batch.fs.InputFile.Status)
@CheckForNull public String hash()
setHash(String)
public int lines()
InputFile
@CheckForNull public String key()
setKey(String)
.
public DefaultInputFile setAbsolutePath(String s)
public DefaultInputFile setLanguage(String language)
public DefaultInputFile setFile(File file)
public DefaultInputFile setType(InputFile.Type type)
public DefaultInputFile setStatus(InputFile.Status status)
public DefaultInputFile setHash(String hash)
public DefaultInputFile setLines(int lines)
public DefaultInputFile setKey(String s)
public String deprecatedKey()
key
on Java files.
public DefaultInputFile setDeprecatedKey(String s)
public String sourceDirAbsolutePath()
public DefaultInputFile setSourceDirAbsolutePath(String s)
public String pathRelativeToSourceDir()
public DefaultInputFile setPathRelativeToSourceDir(String s)
@Deprecated public File getFileBaseDir()
FileSystem.baseDir()
InputFile
For example in maven projects, the basedir of a source file stored in
src/main/java/org/foo/
is the directory src/main/java
.
getFileBaseDir
in interface InputFile
public void setBasedir(File basedir)
@Deprecated public File getFile()
file()
InputFile
getFile
in interface InputFile
@Deprecated public String getRelativePath()
relativePath()
InputFile
'/'
, whatever the platform.
Example on windows: if file basedir is c:\project\src\
and file is c:\project\src\org\foo\Bar.java
, then relative path
is org/foo/Bar.java
Example on unix: if file basedir is /project/src
and file is /project/src/org/foo/Bar.java
, then relative path
is org/foo/Bar.java
as well.
getRelativePath
in interface InputFile
public InputStream getInputStream() throws FileNotFoundException
InputFile
InputStream
that reads from the file.
The returned stream is buffered so there is no need to use a
BufferedInputStream
getInputStream
in interface InputFile
FileNotFoundException
- if the file is not foundpublic boolean equals(Object o)
equals
in class Object
public int hashCode()
hashCode
in class Object
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |