private void createEar(String explodedDir, String earFilePath)
throws Exception {
// create the application object.
ApplicationArchivist archivist = new ApplicationArchivist();
FileArchive appArchive = new FileArchive();
appArchive.open(new File(explodedDir).getAbsolutePath());
archivist.setManifest(appArchive.getManifest());
Application application = null;
if (archivist.hasStandardDeploymentDescriptor(appArchive)) {
application = (Application)
archivist.readStandardDeploymentDescriptor(appArchive);