1 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 15 public class ZipDataSource implements DataSource { 16 private ZipFile zipFile; 17 private ZipEntry zipEntry; 18 19 23 public ZipDataSource(ZipFile zipFile, ZipEntry zipEntry) { 24 this.zipFile = zipFile; 25 this.zipEntry = zipEntry; 26 } 27 28 public InputStream getInputStream() throws IOException { 29 return zipFile.getInputStream(zipEntry); 30 } 31 32 public String getNiceFileName(boolean shortNames, String inputFileName) { 33 return zipFile.getName() + ":" + zipEntry.getName(); 35 } 36 } 37 | Popular Tags |