Class ZipDataSource
- java.lang.Object
-
- net.sourceforge.pmd.util.datasource.ZipDataSource
-
- All Implemented Interfaces:
DataSource
public class ZipDataSource extends java.lang.Object implements DataSource
DataSource implementation to read data from an entry in a zip or jar file.
-
-
Constructor Summary
Constructors Constructor Description ZipDataSource(java.util.zip.ZipFile zipFile, java.util.zip.ZipEntry zipEntry)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)java.io.InputStreamgetInputStream()Get an InputStream on the source file.java.lang.StringgetNiceFileName(boolean shortNames, java.lang.String inputFileName)Return a nice version of the filename.inthashCode()java.lang.StringtoString()
-
-
-
Method Detail
-
getInputStream
public java.io.InputStream getInputStream() throws java.io.IOExceptionDescription copied from interface:DataSourceGet an InputStream on the source file.- Specified by:
getInputStreamin 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:DataSourceReturn a nice version of the filename.- Specified by:
getNiceFileNamein interfaceDataSource- Parameters:
shortNames- true if short names are being usedinputFileName- name of a "master" file this file is relative to- Returns:
- String
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
-