Package org.compiere.util
Class ZipUtil
java.lang.Object
org.compiere.util.ZipUtil
Zip/Jar File Utilities
- Version:
- $Id: ZipUtil.java,v 1.2 2006/07/30 00:54:36 jjanke Exp $
- Author:
- Jorg Janke
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close Zip Filestatic voiddumpManifest(String fileName) Dump Manifest to standard outEnumeration<?>entries()Get ZipEntries as Enumerationstatic StringfindInPath(String jarFile) Get full name of jarfile in class pathString[]Get Content as sorted String ArrayGet Zip Entrystatic ZipEntryGet Zip EntrygetEntryInfo(String name) Get File Infostatic StringgetEntryTime(String fileName, String entryName) Get Zip Entry timegetJar()Get it as Jar if it is a Jarstatic JarFileGet Jar Filestatic JarEntrygetJarEntry(String fileName, String jarEntry) Get jar entryGet Manifest if a Jarstatic ManifestgetManifest(String fileName) Get ManifestbooleanisJar()Is it a JarbooleanisOpen()Is the Zip File OpenbooleanOpen the Zip File for readingbooleanOpen the Zip File for readingtoString()String Representation
-
Constructor Details
-
ZipUtil
public ZipUtil()Empty Constructor, need to open explicitly. -
ZipUtil
Open zip file.- Parameters:
fileName- zip file name
-
ZipUtil
Open zip file.- Parameters:
file- zip file
-
-
Method Details
-
open
Open the Zip File for reading- Parameters:
fileName- zip file- Returns:
- true if opened
-
open
Open the Zip File for reading- Parameters:
file- zip file- Returns:
- true if opened
-
close
public void close()Close Zip File -
isOpen
public boolean isOpen()Is the Zip File Open- Returns:
- true if yes
-
isJar
public boolean isJar()Is it a Jar- Returns:
- true if yes
-
getJar
Get it as Jar if it is a Jar- Returns:
- jar or null if not a jar
-
toString
String Representation -
getContent
Get Content as sorted String Array- Returns:
- content
-
entries
Get ZipEntries as Enumeration- Returns:
- entries
-
getEntry
Get Zip Entry- Parameters:
name- entry name- Returns:
- ZipEntry or null if not found
-
getEntryInfo
Get File Info- Parameters:
name- name- Returns:
- time and size
-
getManifest
Get Manifest if a Jar- Returns:
- Manifest if exists or null
-
getEntry
Get Zip Entry- Parameters:
fileName- zip/jar fileentryName- entry- Returns:
- ZipEntry
-
getJar
Get Jar File- Parameters:
fileName- zip/jar file- Returns:
- Jar
-
getManifest
Get Manifest- Parameters:
fileName- zip/jar file- Returns:
- Manifest or null
-
getJarEntry
Get jar entry- Parameters:
fileName- jar file namejarEntry- jar entry name- Returns:
- jar entry
-
dumpManifest
Dump Manifest to standard out- Parameters:
fileName- zip/jar file
-
getEntryTime
Get Zip Entry time- Parameters:
fileName- zip fileentryName- entry- Returns:
- Timestamp as String or null
-
findInPath
Get full name of jarfile in class path- Parameters:
jarFile- name- Returns:
- full name or null if not found
-