Class FileDataSource
- java.lang.Object
-
- net.sourceforge.pmd.util.datasource.internal.AbstractDataSource
-
- net.sourceforge.pmd.util.datasource.FileDataSource
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,DataSource
public class FileDataSource extends net.sourceforge.pmd.util.datasource.internal.AbstractDataSource
DataSource implementation to read data from a file.
-
-
Constructor Summary
Constructors Constructor Description FileDataSource(File file)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
InputStream
getInputStream()
Get an InputStream on the source file.String
getNiceFileName(boolean shortNames, String inputPaths)
Return a nice version of the filename.int
hashCode()
String
toString()
-
-
-
Constructor Detail
-
FileDataSource
public FileDataSource(File file)
- Parameters:
file
- the file to read
-
-
Method Detail
-
getInputStream
public InputStream getInputStream() throws IOException
Description copied from interface:DataSource
Get an InputStream on the source file.- Returns:
- the InputStream reading the source file
- Throws:
IOException
- if the file can't be opened
-
getNiceFileName
public String getNiceFileName(boolean shortNames, String inputPaths)
Description copied from interface:DataSource
Return a nice version of the filename.- Parameters:
shortNames
- true if short names are being usedinputPaths
- name of a "master" file this file is relative to- Returns:
- String
-
-