public final class JarUtils extends Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
JarUtils.Extractor<T> |
| Modifier and Type | Method and Description |
|---|---|
static void |
closeQuietly(JarFile jarFile)
Quietly close jar file.
|
static Manifest |
getManifest(File file)
Get the
Manifest from a Jar file, or create a new one if there isn't one already. |
static boolean |
hasManifestEntry(Manifest manifest,
String entryName) |
static <T> T |
withJar(File file,
JarUtils.Extractor<T> extractor)
Extract something from a jar file.
|
public static Manifest getManifest(File file)
Manifest from a Jar file, or create a new one if there isn't one already.file - the file that is the jar contentspublic static <T> T withJar(File file, JarUtils.Extractor<T> extractor)
Correctly opens and closes the Jar file. Must not lazily access the Jar as it has an open/closed state.
T - the type of the thing to extractfile - the file that is the jar contentsextractor - RuntimeException - if there are problems accessing the jar contents.public static void closeQuietly(JarFile jarFile)
jarFile - the file to close.Copyright © 2014 Atlassian. All rights reserved.