org.apache.catalina.startup

Class ExpandWar

public class ExpandWar extends Object

Expand out a WAR in a Host's appBase.

Version: $Revision: 892815 $

Author: Craig R. McClanahan Remy Maucherat Glenn L. Nielsen

Field Summary
protected static StringManagersm
The string resources for this package.
Method Summary
static booleancopy(File src, File dest)
Copy the specified file or directory to the destination.
static booleandelete(File dir)
Delete the specified directory, including all of its contents and sub-directories recursively.
static booleandelete(File dir, boolean logFailure)
Delete the specified directory, including all of its contents and sub-directories recursively.
static booleandeleteDir(File dir)
Delete the specified directory, including all of its contents and sub-directories recursively.
static booleandeleteDir(File dir, boolean logFailure)
Delete the specified directory, including all of its contents and sub-directories recursively.
static Stringexpand(Host host, URL war)
Expand the WAR file found at the specified URL into an unpacked directory structure, and return the absolute pathname to the expanded directory.
static Stringexpand(Host host, URL war, String pathname)
Expand the WAR file found at the specified URL into an unpacked directory structure, and return the absolute pathname to the expanded directory.
protected static Fileexpand(InputStream input, File docBase, String name)
Expand the specified input stream into the specified directory, creating a file named from the specified relative path.
static voidvalidate(Host host, URL war, String pathname)
Validate the WAR file found at the specified URL.

Field Detail

sm

protected static final StringManager sm
The string resources for this package.

Method Detail

copy

public static boolean copy(File src, File dest)
Copy the specified file or directory to the destination.

Parameters: src File object representing the source dest File object representing the destination

delete

public static boolean delete(File dir)
Delete the specified directory, including all of its contents and sub-directories recursively. Any failure will be logged.

Parameters: dir File object representing the directory to be deleted

delete

public static boolean delete(File dir, boolean logFailure)
Delete the specified directory, including all of its contents and sub-directories recursively.

Parameters: dir File object representing the directory to be deleted logFailure true if failure to delete the resource should be logged

deleteDir

public static boolean deleteDir(File dir)
Delete the specified directory, including all of its contents and sub-directories recursively. Any failure will be logged.

Parameters: dir File object representing the directory to be deleted

deleteDir

public static boolean deleteDir(File dir, boolean logFailure)
Delete the specified directory, including all of its contents and sub-directories recursively.

Parameters: dir File object representing the directory to be deleted logFailure true if failure to delete the resource should be logged

expand

public static String expand(Host host, URL war)
Expand the WAR file found at the specified URL into an unpacked directory structure, and return the absolute pathname to the expanded directory.

Parameters: host Host war is being installed for war URL of the web application archive to be expanded (must start with "jar:")

Throws: IllegalArgumentException if this is not a "jar:" URL IOException if an input/output error was encountered during expansion

expand

public static String expand(Host host, URL war, String pathname)
Expand the WAR file found at the specified URL into an unpacked directory structure, and return the absolute pathname to the expanded directory.

Parameters: host Host war is being installed for war URL of the web application archive to be expanded (must start with "jar:") pathname Context path name for web application

Throws: IllegalArgumentException if this is not a "jar:" URL or if the WAR file is invalid IOException if an input/output error was encountered during expansion

expand

protected static File expand(InputStream input, File docBase, String name)

Deprecated:

Expand the specified input stream into the specified directory, creating a file named from the specified relative path.

Parameters: input InputStream to be copied docBase Document base directory into which we are expanding name Relative pathname of the file to be created

Returns: A handle to the expanded File

Throws: IOException if an input/output error occurs

validate

public static void validate(Host host, URL war, String pathname)
Validate the WAR file found at the specified URL.

Parameters: host Host war is being installed for war URL of the web application archive to be validated (must start with "jar:") pathname Context path name for web application

Throws: IllegalArgumentException if this is not a "jar:" URL or if the WAR file is invalid IOException if an input/output error was encountered during validation

Copyright © 2000-2011 Apache Software Foundation. All Rights Reserved.