/** * Skips a pack file. * * @param packFile the pack file * @param pack the pack * @param packInputStream the pack stream * @throws IOException if the file cannot be skipped */ protected void skip(PackFile packFile, Pack pack, InputStream packInputStream) throws IOException { if (!pack.isLoose() && !packFile.isBackReference() && !packFile.isPack200Jar()) { long size = packFile.size(); logger.fine("|- Condition not fulfilled - skipping pack stream " + packFile.getTargetPath() + " by " + size + " bytes "); skip(packInputStream, packFile.size()); } }
if (!packFile.isPack200Jar()) skip(packStream, size); } else if (packFile.isPack200Jar())
if (!packFile.isBackReference() && !pack.isLoose() && !packFile.isPack200Jar())
File file = packInfo.getFile(packFile); boolean pack200 = packFile.isPack200Jar();
/** * Creates an unpacker to unpack a pack file. * * @param file the pack file to unpack * @param pack the parent pack * @param queue the file queue. May be {@code null} * @param cancellable determines if the unpacker should be cancelled * @return the unpacker * @throws InstallerException for any installer error */ protected FileUnpacker createFileUnpacker(PackFile file, Pack pack, FileQueue queue, Cancellable cancellable) throws InstallerException { PackCompression compressionFormat = getInstallData().getInfo().getCompressionFormat(); FileUnpacker unpacker; if (pack.isLoose()) { unpacker = new LooseFileUnpacker(cancellable, queue, prompt); } else if (file.isPack200Jar()) { unpacker = new Pack200FileUnpacker(cancellable, resources, queue); } else if (compressionFormat != PackCompression.DEFAULT) { unpacker = new CompressedFileUnpacker(cancellable, queue, compressionFormat); } else { unpacker = new DefaultFileUnpacker(cancellable, queue); } return unpacker; }