/** * <p> * Convenience method to return the entry's content as a String if isUnixSymlink() * returns true for it, otherwise returns null. * </p> * * <p>This method assumes the symbolic link's file name uses the * same encoding that as been specified for this ZipFile.</p> * * @param entry ZipArchiveEntry object that represents the symbolic link * @return entry's content as a String * @throws IOException problem with content's input stream * @since 1.5 */ public String getUnixSymlink(final ZipArchiveEntry entry) throws IOException { if (entry != null && entry.isUnixSymlink()) { try (InputStream in = getInputStream(entry)) { return zipEncoding.decode(IOUtils.toByteArray(in)); } } return null; }
@Override public boolean isSymbolicLink() { return zipEntry.isUnixSymlink(); }
@Override public boolean isFile() { return !zipEntry.isDirectory() && !zipEntry.isUnixSymlink(); }
private String resolveSymlink( ZipFile zf, ZipArchiveEntry ze ) throws IOException { if ( ze.isUnixSymlink() ) { return zf.getUnixSymlink( ze ); } else { return null; } }
@Override public PlexusIoResource next() { final ZipArchiveEntry entry = en.nextElement(); return entry.isUnixSymlink() ? new ZipFileSymlinkResource( jarFile, entry ) : new ZipFileResource( jarFile, entry ); }
@Override public PlexusIoResource next() { final ZipArchiveEntry entry = (ZipArchiveEntry) en.nextElement(); return entry.isUnixSymlink() ? new ZipSymlinkResource( zipFile, entry, getStreamTransformer() ) : new ZipResource( zipFile, entry, getStreamTransformer() ); }
if ( zipArchiveEntry.isDirectory() && !zipArchiveEntry.isUnixSymlink() )
boolean cygwin = windows && new File(System.getProperty("karaf.home"), "bin/admin").exists(); if (!entry.isDirectory() && !entry.isUnixSymlink()) { if (windows && !cygwin) { if (name.startsWith("bin/") && !name.endsWith(".bat")) {
boolean cygwin = windows && new File(System.getProperty("karaf.home"), "bin/admin").exists(); if (!entry.isDirectory() && !entry.isUnixSymlink()) { if (windows && !cygwin) { if (name.startsWith("bin/") && !name.endsWith(".bat")) {
public void addEntry(ZipArchiveEntry zipArchiveEntry, InputStreamSupplier streamSupplier) throws IOException { if (zipArchiveEntry.isDirectory() && !zipArchiveEntry.isUnixSymlink()) dirs.addArchiveEntry(ZipArchiveEntryRequest.createZipArchiveEntryRequest(zipArchiveEntry, streamSupplier)); else scatterZipCreator.addArchiveEntry(zipArchiveEntry, streamSupplier); }
/** * <p> * Convenience method to return the entry's content as a String if isUnixSymlink() * returns true for it, otherwise returns null. * </p> * * <p>This method assumes the symbolic link's file name uses the * same encoding that as been specified for this ZipFile.</p> * * @param entry ZipArchiveEntry object that represents the symbolic link * @return entry's content as a String * @throws IOException problem with content's input stream * @since 1.5 */ public String getUnixSymlink(final ZipArchiveEntry entry) throws IOException { if (entry != null && entry.isUnixSymlink()) { try (InputStream in = getInputStream(entry)) { return zipEncoding.decode(IOUtils.toByteArray(in)); } } return null; }
continue; if (!entry.isDirectory() && !entry.isUnixSymlink()) { File file = new File(fork.getRepository().getWorkTree(), name); file.getParentFile().mkdirs();
continue; if (!entry.isDirectory() && !entry.isUnixSymlink()) { File file = new File(fork.getRepository().getWorkTree(), name); file.getParentFile().mkdirs();
skipRootDir = true; if (entry.isDirectory() || entry.isUnixSymlink()) { continue;
skipRootDir = true; if (entry.isDirectory() || entry.isUnixSymlink()) { continue;
File entryFile = new File(out, name); progress.setSecondaryText(name); if (entry.isUnixSymlink()) { ByteArrayOutputStream targetByteStream = new ByteArrayOutputStream(); readZipEntry(zipFile, entry, targetByteStream, expectedSize, progress);