VirtualDirTgz extends VirtualDir { @Override public InputStream getInputStream(String path) throws IOException { final File file = getFile(path); return new BufferedInputStream(new FileInputStream(file)); } VirtualDirTgz(File tgz); @Override String getBasePath(); @Override File getBaseFile(); @Override InputStream getInputStream(String path); @Override File getFile(String path); @Override String[] list(String path); @Override boolean exists(String path); @Override String[] listAllFiles(); @Override void close(); @Override boolean isCompressed(); @Override boolean isArchive(); @Override void finalize(); @Override File getTempDir();  }
@Test(expected = IOException.class) public void testTar_getInputStream_invalidPath() throws IOException { final File testTgz = TestUtil.getTestFile("tgz/test-archive.tar"); virtualDir = new VirtualDirTgz(testTgz); virtualDir.getInputStream("test-archive/invalid_dir/no.file"); }
@Test(expected = IOException.class) public void testTgz_getInputStream_invalidPath() throws IOException { final File testTgz = TestUtil.getTestFile("tgz/test-archive.tgz"); virtualDir = new VirtualDirTgz(testTgz); virtualDir.getInputStream("test-archive/invalid_dir/no.file"); }