Java Code Examples for java.util.jar.JarEntry#getComment()
The following examples show how to use
java.util.jar.JarEntry#getComment() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Jar.java From helidon-build-tools with Apache License 2.0 | 6 votes |
private static JarEntry newJarEntry(Entry entry) { final JarEntry result = new JarEntry(entry.getName()); if (result.getCreationTime() != null) { result.setCreationTime(entry.getCreationTime()); } if (result.getLastModifiedTime() != null) { result.setLastModifiedTime(entry.getLastModifiedTime()); } if (entry.getExtra() != null) { result.setExtra(entry.getExtra()); } if (result.getComment() != null) { result.setComment(entry.getComment()); } if (!entry.isDirectory()) { final int method = entry.getMethod(); if (method == JarEntry.STORED || method == ZipEntry.DEFLATED) { result.setMethod(method); } } return result; }
Example 2
Source File: Repackager.java From sofa-ark with Apache License 2.0 | 6 votes |
@Override public JarEntry transform(JarEntry entry) { JarEntry renamedEntry = new JarEntry(this.namePrefix + entry.getName()); renamedEntry.setTime(entry.getTime()); renamedEntry.setSize(entry.getSize()); renamedEntry.setMethod(entry.getMethod()); if (entry.getComment() != null) { renamedEntry.setComment(entry.getComment()); } renamedEntry.setCompressedSize(entry.getCompressedSize()); renamedEntry.setCrc(entry.getCrc()); //setCreationTimeIfPossible(entry, renamedEntry); if (entry.getExtra() != null) { renamedEntry.setExtra(entry.getExtra()); } return renamedEntry; }
Example 3
Source File: JarFileArchive.java From sofa-ark with Apache License 2.0 | 5 votes |
public Archive getNestedArchive(Entry entry) throws IOException { JarEntry jarEntry = ((JarFileEntry) entry).getJarEntry(); if (jarEntry.getComment() != null && jarEntry.getComment().startsWith(UNPACK_MARKER)) { return getUnpackedNestedArchive(jarEntry); } try { JarFile jarFile = this.jarFile.getNestedJarFile(jarEntry); return new JarFileArchive(jarFile); } catch (Exception ex) { throw new IllegalStateException("Failed to get nested archive for entry " + entry.getName(), ex); } }