donaldp 02/02/01 04:24:45
Modified: src/java/org/apache/avalon/phoenix/tools/installer
Installer.java
Log:
Make sure that installation extracts all contents of jar except for those
contents in SAR-INF/classes
Make sure that the application will use the assembly.xml file extracted onto
filesystem
Revision Changes Path
1.26 +26 -28
jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/tools/installer/Installer.java
Index: Installer.java
===================================================================
RCS file:
/home/cvs/jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/tools/installer/Installer.java,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- Installer.java 25 Jan 2002 21:50:50 -0000 1.25
+++ Installer.java 1 Feb 2002 12:24:44 -0000 1.26
@@ -59,6 +59,7 @@
//The names on the native filesystem
private static final String FS_CONFIG_XML = "SAR-INF" + File.separator +
"config.xml";
+ private static final String FS_ASSEMBLY_XML = "SAR-INF" + File.separator
+ "assembly.xml";
private static final String FS_SERVER_XML = "SAR-INF" + File.separator +
"server.xml";
private static final String FS_ENV_XML = "SAR-INF" + File.separator +
"environment.xml";
@@ -271,6 +272,8 @@
final ArrayList digests = new ArrayList();
final ArrayList jars = new ArrayList();
+ boolean classesAdded = false;
+
final Enumeration entries = zipFile.entries();
while( entries.hasMoreElements() )
{
@@ -281,43 +284,37 @@
boolean expand = true;
boolean isJar = false;
- boolean classesAdded = false;
- //Don't expand anything below SAR-INF directory unless they
- //are the config.xml or server.xml files which will be expanded
- //as a special case atm.
- //NOTE: We expand everything at this time now but this will
change
- //in the future
- if( name.startsWith( SAR_INF ) &&
- !name.equals( SERVER_XML ) &&
- !name.equals( ENV_XML ) &&
- !name.equals( CONFIG_XML ) )
+ if( name.startsWith( CLASSES ) )
{
- //expand = false;
-
- if( false == classesAdded &&
- name.startsWith( CLASSES ) )
+ expand = false;
+ if( false == classesAdded )
{
final String classes =
"jar:" + getURLAsString( file ) + "!/" + CLASSES;
jars.add( classes );
- expand = false;
+ classesAdded = true;
}
+ }
- //Grab all the jar files in the
- //directory SAR-INF/lib
- if( name.startsWith( LIB ) &&
- name.endsWith( ".jar" ) &&
- LIB.length() == name.lastIndexOf( "/" ) )
- {
- isJar = true;
- expand = true;
- //HACK: expand files until ClassLoader works properly
- //final String jar = baseURL + name;
- //jars.add( jar );
- }
+ //Grab all the jar files in the
+ //directory SAR-INF/lib
+ if( name.startsWith( LIB ) &&
+ name.endsWith( ".jar" ) &&
+ LIB.length() == name.lastIndexOf( "/" ) )
+ {
+ isJar = true;
+ //HACK: expand files until ClassLoader works properly
+ //final String jar = baseURL + name;
+ //jars.add( jar );
}
+ //Don't expand anything below SAR-INF directory unless they
+ //are the config.xml or server.xml files which will be expanded
+ //as a special case atm.
+ //NOTE: We expand everything at this time now but this will
change
+ //in the future
+
if( name.startsWith( META_INF ) )
{
expand = false;
@@ -359,7 +356,8 @@
//Prepare and create Installation
final String[] classPath = (String[])jars.toArray( new String[ 0 ] );
- final String assembly = "jar:" + getURLAsString( file ) + "!/" +
ASSEMBLY_XML;
+ //final String assembly = "jar:" + getURLAsString( file ) + "!/" +
ASSEMBLY_XML;
+ final String assembly = getURLAsString( new File( directory,
FS_ASSEMBLY_XML ) );
final String config = getURLAsString( new File( directory,
FS_CONFIG_XML ) );
final String environment = getURLAsString( envFile );
final FileDigest[] fileDigests = (FileDigest[])digests.toArray( new
FileDigest[ 0 ] );
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>