Class ZipDataSource
- java.lang.Object
-
- net.sourceforge.pmd.util.datasource.internal.AbstractDataSource
-
- net.sourceforge.pmd.util.datasource.ZipDataSource
-
- All Implemented Interfaces:
Closeable,AutoCloseable,DataSource
public class ZipDataSource extends net.sourceforge.pmd.util.datasource.internal.AbstractDataSourceDataSource implementation to read data from an entry in a zip or jar file.
-
-
Constructor Summary
Constructors Constructor Description ZipDataSource(ZipFile zipFile, ZipEntry zipEntry)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()booleanequals(Object obj)InputStreamgetInputStream()Get an InputStream on the source file.StringgetNiceFileName(boolean shortNames, String inputFileName)Return a nice version of the filename.inthashCode()StringtoString()
-
-
-
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 inputFileName)
Description copied from interface:DataSourceReturn a nice version of the filename.- Parameters:
shortNames- true if short names are being usedinputFileName- name of a "master" file this file is relative to- Returns:
- String
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classnet.sourceforge.pmd.util.datasource.internal.AbstractDataSource- Throws:
IOException
-
-