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