1 25 26 27 package org.objectweb.jonas_lib.genbase.modifier; 28 29 import java.io.File ; 30 import java.util.jar.JarFile ; 31 32 33 40 public abstract class AbsModifierFactory { 41 42 45 public static final int APPLICATION = 0; 46 47 50 public static final int EJBJAR = 1; 51 52 55 public static final int WEBAPP = 2; 56 57 60 public static final int CLIENT = 3; 61 62 65 protected AbsModifierFactory() { 66 67 } 68 69 76 protected static boolean isApplication(JarFile jf) { 77 return jf.getEntry("META-INF/application.xml") != null; 78 } 79 80 87 protected static boolean isEjbJar(JarFile jf) { 88 return jf.getEntry("META-INF/ejb-jar.xml") != null; 89 } 90 91 98 protected static boolean isWebApp(JarFile jf) { 99 return jf.getEntry("WEB-INF/web.xml") != null; 100 } 101 102 109 protected static boolean isClient(JarFile jf) { 110 return jf.getEntry("META-INF/application-client.xml") != null; 111 } 112 113 120 protected static boolean isApplication(File f) { 121 return new File (f, "META-INF" + File.separator + "application.xml").exists(); 122 } 123 124 131 protected static boolean isEjbJar(File f) { 132 return new File (f, "META-INF" + File.separator + "ejb-jar.xml").exists(); 133 } 134 135 142 protected static boolean isWebApp(File f) { 143 return new File (f, "WEB-INF" + File.separator + "web.xml").exists(); 144 } 145 146 153 protected static boolean isClient(File f) { 154 return new File (f, "META-INF" + File.separator + "application-client.xml").exists(); 155 } 156 } | Popular Tags |