ExpandWar (Tomcat API Documentation)
Keywords: org.apache.catalina.startup.ExpandWar class

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.catalina.startup
Class ExpandWar

    java.lang.Object
      org.apache.catalina.startup.ExpandWar

    public class ExpandWar

extends java.lang.Object

Expand out a WAR in a Host's appBase.

Version:
  $Revision: 467222 $
Author:
  Craig R. McClanahan, Remy Maucherat, Glenn L. Nielsen

Field Summary
`protected static StringManager` | `sm` The string resources for this package.

Constructor Summary
`ExpandWar()`

Method Summary
`static boolean` | `copy(java.io.File src, java.io.File dest)` Copy the specified file or directory to the destination.
`static boolean` | `delete(java.io.File dir)` Delete the specified directory, including all of its contents and subdirectories recursively.
`static boolean` | `deleteDir(java.io.File dir)` Delete the specified directory, including all of its contents and subdirectories recursively.
`static java.lang.String` | `expand(Host host, java.net.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 java.lang.String` | `expand(Host host, java.net.URL war, java.lang.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 java.io.File` | `expand(java.io.InputStream input, java.io.File docBase, java.lang.String name)` Expand the specified input stream into the specified directory, creating a file named from the specified relative path.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### sm

    protected static final StringManager sm

  The string resources for this package.

Constructor Detail

### ExpandWar

    public ExpandWar()

Method Detail

### expand

    public static java.lang.String expand(Host host,
                                          java.net.URL war)
                                   throws java.io.IOException

  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:
    `java.lang.IllegalArgumentException` - if this is not a "jar:" URL
    `java.io.IOException` - if an input/output error was encountered during expansion

### expand

    public static java.lang.String expand(Host host,
                                          java.net.URL war,
                                          java.lang.String pathname)
                                   throws java.io.IOException

  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:
    `java.lang.IllegalArgumentException` - if this is not a "jar:" URL
    `java.io.IOException` - if an input/output error was encountered during expansion

### copy

    public static boolean copy(java.io.File src,
                               java.io.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(java.io.File dir)

  Delete the specified directory, including all of its contents and subdirectories recursively.

  Parameters:
    `dir` - File object representing the directory to be deleted

### deleteDir

    public static boolean deleteDir(java.io.File dir)

  Delete the specified directory, including all of its contents and subdirectories recursively.

  Parameters:
    `dir` - File object representing the directory to be deleted

### expand

    protected static java.io.File expand(java.io.InputStream input,
                                         java.io.File docBase,
                                         java.lang.String name)
                                  throws java.io.IOException

  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:
    `java.io.IOException` - if an input/output error occurs

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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