if (moduleDirName.endsWith("_jar") || moduleDirName.endsWith("_war") || moduleDirName.endsWith("_rar")) {
moduleName = moduleDirName.substring(0,moduleDirName.lastIndexOf('_'));
}
try {
JarArchiveFactory jaf = new JarArchiveFactory();
FileArchiveFactory faf = new FileArchiveFactory();
FileArchive farc = (FileArchive)faf.openArchive(new File(new File(new File(sourceDir, appDir), earDirName), moduleDirName).getAbsolutePath());
String suffix = ".jar"; //default to .jar
//File temp;
Enumeration e = farc.entries();
//figure out what type of module this is by the existance of the standard dd's
while(e.hasMoreElements()) {
String entry = (String)e.nextElement();
if (entry.equalsIgnoreCase("WEB-INF/web.xml")) {
suffix = ".war";
} else if (entry.equalsIgnoreCase("META-INF/ra.xml")) {
suffix = ".rar";
}
}
//temp = File.createTempFile(moduleName, suffix);
File tempJar = new File(targetDir, moduleName + suffix);
String path = tempJar.getAbsolutePath();
//temp.delete();
OutputJarArchive targetModule = (OutputJarArchive)jaf.createArchive(path);
logger.fine(stringManager.getString("upgrade.deployment.addingInfoMsg") + targetModule.getArchiveUri());
e = farc.entries();
while(e.hasMoreElements()) {
String entry = (String)e.nextElement();
InputStream in = farc.getEntry(entry);