public abstract class JarUtils extends Object
Constructor and Description |
---|
JarUtils() |
Modifier and Type | Method and Description |
---|---|
static boolean |
checkEntryExists(File file,
String entryName)
Sprawdza, czy w podanym pliku (który musi być plikiem jar) istnieje wpis
JarEntry o podanej nazwie. |
static void |
copyWithManifest(File source,
File target,
Manifest manifest)
Kopiuje całą zawartość jednego pliku jar do drugiego pliku jar z nowym manifestem.
|
static JarInputStream |
getInputStream(File file)
Zwraca
JarInputStream podanego pliku. |
static InputStream |
getJarEntryInputStream(File file,
String entryName) |
static boolean |
isJarFile(URL url) |
static Manifest |
readManifest(File file)
Odczytuje manifest z podanego pliku jar
|
public static boolean checkEntryExists(File file, String entryName) throws IOException
JarEntry
o podanej nazwie.file
- Plik jarentryName
- Nazwa wpisu JarEntry
true
jeżeli taki wpis isnieje w podanym pliku jarIOException
- Błąd podczas odczytu pliku jarpublic static InputStream getJarEntryInputStream(File file, String entryName) throws IOException
IOException
public static JarInputStream getInputStream(File file) throws FileNotFoundException, IOException
JarInputStream
podanego pliku.
UWAGA: Ten input stream musi zotać zamknięty manualnie.FileNotFoundException
IOException
public static Manifest readManifest(File file) throws IOException
file
- plik źródłowy jarIOException
- błąd IOpublic static void copyWithManifest(File source, File target, Manifest manifest) throws IOException
source
- plik źródłowytarget
- plik docelowymanifest
- nowy manifest pliku jarIOException
public static boolean isJarFile(URL url)
Copyright © 2014 Suncode. All rights reserved.