org.appfuse
Class WarPathUtils

java.lang.Object
  extended by org.appfuse.WarPathUtils

public class WarPathUtils
extends java.lang.Object

Static utility class to help with War file processing.


Field Summary
static java.util.regex.Pattern WEBINF_CLASSES_PATTERN
           
 
Constructor Summary
WarPathUtils()
           
 
Method Summary
static void unpackWarClassesIfNewer(java.io.File warFile, java.io.File classesJarFile, java.lang.String includes, java.lang.String excludes)
          Unpack the WEB-INF/classes directory from the specified war file if the contents of the target directory is older than the war file.
static void unpackWebInfClasses(java.util.zip.ZipFile zipFile, java.util.jar.JarOutputStream classesJarOutputStream, java.lang.String includes, java.lang.String excludes)
          Extract the WEB-INF/classes entries from the specified war file into the named directory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WEBINF_CLASSES_PATTERN

public static final java.util.regex.Pattern WEBINF_CLASSES_PATTERN
Constructor Detail

WarPathUtils

public WarPathUtils()
Method Detail

unpackWarClassesIfNewer

public static void unpackWarClassesIfNewer(java.io.File warFile,
                                           java.io.File classesJarFile,
                                           java.lang.String includes,
                                           java.lang.String excludes)
                                    throws java.io.IOException
Unpack the WEB-INF/classes directory from the specified war file if the contents of the target directory is older than the war file.

Parameters:
warFile - The war file to unpack.
classesJarFile - The target jar file which will hold the contents of the WEB-INF/classes directory.
includes - Comma separated list of resource patterns to include in the path
excludes - Comma separated list of resource patterns to exclude from the path.
Throws:
java.io.IOException - if an I/O error occurs.

unpackWebInfClasses

public static void unpackWebInfClasses(java.util.zip.ZipFile zipFile,
                                       java.util.jar.JarOutputStream classesJarOutputStream,
                                       java.lang.String includes,
                                       java.lang.String excludes)
                                throws java.io.IOException
Extract the WEB-INF/classes entries from the specified war file into the named directory.

Parameters:
zipFile - The war file to unpack
classesJarOutputStream - The target directory.
includes - Comma separated patterns to match against resources to include
excludes - Comma separated patterns to match against resources to exclude
Throws:
java.io.IOException - if an I/O error occurs during the unpacking.


Copyright © 2003-2007. All Rights Reserved.