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.AbstractDataSourceDataSource 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 booleanequals(Object obj)InputStreamgetInputStream()Get an InputStream on the source file.StringgetNiceFileName(boolean shortNames, String inputPaths)Return a nice version of the filename.inthashCode()StringtoString()
-
-
-
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:DataSourceGet 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:DataSourceReturn 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
-
-