List of usage examples for org.apache.commons.vfs2.provider.bzip2 Bzip2FileObject wrapInputStream
public static InputStream wrapInputStream(final String name, final InputStream is) throws IOException
From source file:org.ysb33r.groovy.vfsplugin.cpio.CpioFileSystem.java
protected CpioArchiveInputStream createCpioFile(final File file) throws FileSystemException { try {/*from w w w. j ava 2s . c om*/ if ("cpiogz".equalsIgnoreCase(getRootName().getScheme())) { return new CpioArchiveInputStream(new GZIPInputStream(new FileInputStream(file))); } else if ("cpiobz2".equalsIgnoreCase(getRootName().getScheme())) { return new CpioArchiveInputStream( Bzip2FileObject.wrapInputStream(file.getAbsolutePath(), new FileInputStream(file))); } return new CpioArchiveInputStream(new FileInputStream(file)); } catch (final IOException ioe) { throw new FileSystemException("vfs.provider.Cpio/open-Cpio-file.error", file, ioe); } }