Class ExpandJar
java.lang.Object
org.glassfish.grizzly.http.server.util.ExpandJar
Expand out a jar.
Adapted from Tomcat's org.apache.catalina.startup.ExpendWar classes
- Author:
- Jeanfrancois Arcand
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanCopy the specified file or directory to the destination.static booleanDelete the specified directory, including all of its contents and subdirectories recursively.static booleanDelete the specified directory, including all of its contents and subdirectories recursively.protected static voidexpand(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 StringExpand the jar file found at the specified URL into an unpacked directory structure, and return the absolute pathname to the expanded directory.static StringExpand the jar file found at the specified URL into an unpacked directory structure, and return the absolute pathname to the expanded directory.static StringExpand the jar file found at the specified URL into an unpacked directory structure, and return the absolute pathname to the expanded directory.
-
Constructor Details
-
ExpandJar
public ExpandJar()
-
-
Method Details
-
expand
Expand the jar file found at the specified URL into an unpacked directory structure, and return the absolute pathname to the expanded directory.- Parameters:
jar- URL of the web application archive to be expanded (must start with "jar:")- Returns:
- Absolute path as in
File.getAbsolutePath()of location where to find expanded jar. - Throws:
IllegalArgumentException- if this is not a "jar:" URLIOException- if an input/output error was encountered during expansion
-
expand
Expand the jar file found at the specified URL into an unpacked directory structure, and return the absolute pathname to the expanded directory.- Parameters:
jar- URL of the web application archive to be expanded (must start with "jar:")workFolder- the folder where the file will be expanded- Returns:
- Absolute path as in
File.getAbsolutePath()of location where to find expanded jar. - Throws:
IllegalArgumentException- if this is not a "jar:" URLIOException- if an input/output error was encountered during expansion
-
expand
Expand the jar file found at the specified URL into an unpacked directory structure, and return the absolute pathname to the expanded directory.- Parameters:
jar- URL of the web application archive to be expanded (must start with "jar:")pathname- Context path name for web application- Returns:
- Absolute path as in
File.getAbsolutePath()of location where to find expanded jar. - Throws:
IllegalArgumentException- if this is not a "jar:" URLIOException- if an input/output error was encountered during expansion
-
copy
Copy the specified file or directory to the destination.- Parameters:
src- File object representing the sourcedest- File object representing the destination
-
delete
Delete the specified directory, including all of its contents and subdirectories recursively.- Parameters:
dir- File object representing the directory to be deleted
-
deleteDir
Delete the specified directory, including all of its contents and subdirectories recursively.- Parameters:
dir- File object representing the directory to be deleted
-
expand
Expand the specified input stream into the specified directory, creating a file named from the specified relative path.- Parameters:
input- InputStream to be copieddocBase- Document base directory into which we are expandingname- Relative pathname of the file to be created- Throws:
IOException- if an input/output error occurs
-