Code example for ZipFile

Methods: closegetEntrygetInputStream

0
  } 
   
  /** Run a vocabulary test against two data files inside a zip file */ 
  public static void assertVocabulary(Analyzer a, File zipFile, String voc, String out)
  throws IOException { 
    ZipFile zip = new ZipFile(zipFile);
    InputStream v = zip.getInputStream(zip.getEntry(voc));
    InputStream o = zip.getInputStream(zip.getEntry(out));
    assertVocabulary(a, v, o);
    v.close();
    o.close();
    zip.close();
  } 
   
  /** Run a vocabulary test against a tab-separated data file inside a zip file */ 
  public static void assertVocabulary(Analyzer a, File zipFile, String vocOut)
  throws IOException { 
    ZipFile zip = new ZipFile(zipFile);
    InputStream vo = zip.getInputStream(zip.getEntry(vocOut));
    assertVocabulary(a, vo);
    vo.close();