00001
00027 package org.objectweb.jonas_lib.genbase.modifier;
00028
00029 import java.io.File;
00030 import java.util.jar.JarFile;
00031
00032
00040 public abstract class AbsModifierFactory {
00041
00045 public static final int APPLICATION = 0;
00046
00050 public static final int EJBJAR = 1;
00051
00055 public static final int WEBAPP = 2;
00056
00060 public static final int CLIENT = 3;
00061
00065 protected AbsModifierFactory() {
00066
00067 }
00068
00076 protected static boolean isApplication(JarFile jf) {
00077 return jf.getEntry("META-INF/application.xml") != null;
00078 }
00079
00087 protected static boolean isEjbJar(JarFile jf) {
00088 return jf.getEntry("META-INF/ejb-jar.xml") != null;
00089 }
00090
00098 protected static boolean isWebApp(JarFile jf) {
00099 return jf.getEntry("WEB-INF/web.xml") != null;
00100 }
00101
00109 protected static boolean isClient(JarFile jf) {
00110 return jf.getEntry("META-INF/application-client.xml") != null;
00111 }
00112
00120 protected static boolean isApplication(File f) {
00121 return new File(f, "META-INF" + File.separator + "application.xml").exists();
00122 }
00123
00131 protected static boolean isEjbJar(File f) {
00132 return new File(f, "META-INF" + File.separator + "ejb-jar.xml").exists();
00133 }
00134
00142 protected static boolean isWebApp(File f) {
00143 return new File(f, "WEB-INF" + File.separator + "web.xml").exists();
00144 }
00145
00153 protected static boolean isClient(File f) {
00154 return new File(f, "META-INF" + File.separator + "application-client.xml").exists();
00155 }
00156 }