/** * A zip or jar archive containing source files. */ static class ZipSourceRepository implements SourceRepository { ZipFile zipFile; public ZipSourceRepository(@WillCloseWhenClosed ZipFile zipFile) { this.zipFile = zipFile; } @Override public boolean contains(String fileName) { return zipFile.getEntry(fileName) != null; } @Override public boolean isPlatformDependent() { return false; } @Override public SourceFileDataSource getDataSource(String fileName) { return new ZipSourceFileDataSource(zipFile, fileName); } @Override public void close() throws IOException { zipFile.close(); } }
/** * A zip or jar archive containing source files. */ static class ZipSourceRepository implements SourceRepository { ZipFile zipFile; public ZipSourceRepository(ZipFile zipFile) { this.zipFile = zipFile; } @Override public boolean contains(String fileName) { return zipFile.getEntry(fileName) != null; } @Override public boolean isPlatformDependent() { return false; } @Override public SourceFileDataSource getDataSource(String fileName) { return new ZipSourceFileDataSource(zipFile, fileName); } }