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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Close Zip Filestatic void
dumpManifest
(String fileName) Dump Manifest to standard outEnumeration<?>
entries()
Get ZipEntries as Enumerationstatic String
findInPath
(String jarFile) Get full name of jarfile in class pathString[]
Get Content as sorted String ArrayGet Zip Entrystatic ZipEntry
Get Zip EntrygetEntryInfo
(String name) Get File Infostatic String
getEntryTime
(String fileName, String entryName) Get Zip Entry timegetJar()
Get it as Jar if it is a Jarstatic JarFile
Get Jar Filestatic JarEntry
getJarEntry
(String fileName, String jarEntry) Get jar entryGet Manifest if a Jarstatic Manifest
getManifest
(String fileName) Get Manifestboolean
isJar()
Is it a Jarboolean
isOpen()
Is the Zip File Openboolean
Open the Zip File for readingboolean
Open 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
-