Clover coverage report - PMD - 3.7 Coverage timestamp: Wed May 31 2006 09:25:59 EDT FRAMES NO FRAMES |

file stats: | LOC: | 36 |  | Methods: | 3
| NCLOC: | 19 |  | Classes: | 1

Source file | Conditionals | Statements | Methods | TOTAL
ZipDataSource.java | - | 0% | 0% | 0% |

1 |  | /**
2 |  | * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
3 |  | */
4 |  | package net.sourceforge.pmd;
5 |  |
6 |  | import java.io.IOException;
7 |  | import java.io.InputStream;
8 |  | import java.util.zip.ZipEntry;
9 |  | import java.util.zip.ZipFile;
10 |  |
11 |  | /**
12 |  | * DataSource implementation to read data from an entry
13 |  | * in a zip or jar file.
14 |  | */
15 |  | public class ZipDataSource implements DataSource {
16 |  | private ZipFile zipFile;
17 |  | private ZipEntry zipEntry;
18 |  |
19 |  | /**
20 |  | * @param zipFile the ZipFile
21 |  | * @param zipEntry the ZipEntry containing the file to read
22 |  | */
23 | 0 | public ZipDataSource(ZipFile zipFile, ZipEntry zipEntry) {
24 | 0 | this.zipFile = zipFile;
25 | 0 | this.zipEntry = zipEntry;
26 |  | }
27 |  |
28 | 0 | public InputStream getInputStream() throws IOException {
29 | 0 | return zipFile.getInputStream(zipEntry);
30 |  | }
31 |  |
32 | 0 | public String getNiceFileName(boolean shortNames, String inputFileName) {
33 |  | // FIXME: this could probably be done better
34 | 0 | return zipFile.getName() + ":" + zipEntry.getName();
35 |  | }
36 |  | }