org.jboss.soa.esb.util
Class JarUtil

java.lang.Object
  extended by org.jboss.soa.esb.util.JarUtil

public class JarUtil
extends java.lang.Object

Util class for dealing with zip archives.

Author:
Daniel Bevenius

Method Summary
static java.util.Map<java.lang.String,java.lang.String> extractStringContents(java.lang.String fileSuffix, java.lang.String charSet, java.util.zip.ZipInputStream inStream)
          Extracts all the files ending with the fileSuffix and adds the file name as the key in the returned map.
static java.util.Map<java.lang.String,java.lang.String> extractStringContents(java.lang.String fileSuffix, java.util.zip.ZipInputStream inStream)
          Extracts all the files ending with the fileSuffix and adds the file name as the key in the returned map.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

extractStringContents

public static java.util.Map<java.lang.String,java.lang.String> extractStringContents(java.lang.String fileSuffix,
                                                                                     java.lang.String charSet,
                                                                                     java.util.zip.ZipInputStream inStream)
                                                                              throws java.io.IOException
Extracts all the files ending with the fileSuffix and adds the file name as the key in the returned map. The contents of the file is the value of the map entry.

Parameters:
fileSuffix - the suffix of files that should be returned.
charSet - the character set that files should be read with.
inStream - the ZipInputStream that is to be processed.
Returns:
Map A Map containg the file name as its key and the file contents as its value.
Throws:
java.io.IOException

extractStringContents

public static java.util.Map<java.lang.String,java.lang.String> extractStringContents(java.lang.String fileSuffix,
                                                                                     java.util.zip.ZipInputStream inStream)
                                                                              throws java.io.IOException
Extracts all the files ending with the fileSuffix and adds the file name as the key in the returned map. The contents of the file is the value of the map entry.

Calling this method is equivalent to calling: extractStringContents(suffix, Charset.defaultCharset().name(), inStream).

Parameters:
fileSuffix - the suffix of files that should be returned.
inStream - the ZipInputStream that is to be processed.
Returns:
Map A Map containg the file name as its key and the file contents as its value.
Throws:
java.io.IOException