1 20 package org.jahia.data.webapps; 21 22 import java.util.Vector ; 23 24 31 public class JahiaWebAppsPackage { 32 33 37 private Vector m_WebApps = new Vector (); 38 39 43 private String m_ContextRoot ; 44 45 46 private String m_FileName; 47 48 49 private String m_FilePath; 50 51 52 private int m_Type ; 54 55 private static final int WAR = 1; 56 57 58 private static final int EAR = 2; 59 60 61 public static final int DIR = 3; 62 63 64 private boolean m_HasEJB = false; 65 66 67 72 public JahiaWebAppsPackage ( String contextRoot ) { 73 m_ContextRoot = contextRoot; 74 } 75 76 81 public Vector getWebApps(){ 82 83 return m_WebApps; 84 85 } 86 87 92 public void addWebAppDef(Vector vec){ 93 94 m_WebApps.addAll(vec); 95 96 } 97 98 99 104 public void addWebAppDef(JahiaWebAppDef webAppDef ){ 105 106 m_WebApps.add(webAppDef); 107 108 } 109 110 111 116 public String getContextRoot(){ 117 118 return m_ContextRoot; 119 120 } 121 122 123 127 public String getFileName(){ 128 return this.m_FileName; 129 } 130 131 132 136 public void setFileName(String name){ 137 this.m_FileName = name; 138 139 if ( name.endsWith(".war") ){ 140 m_Type = WAR; 141 } else if ( name.endsWith(".ear") ){ 142 m_Type = EAR; 143 } else { 144 m_Type = DIR; 145 } 146 } 147 148 149 153 public String getFilePath(){ 154 return this.m_FilePath; 155 } 156 157 161 public void setFilePath(String path){ 162 this.m_FilePath = path; 163 } 164 165 166 167 171 public boolean isWarFile(){ 172 return (m_Type == WAR); 173 } 174 175 176 180 public boolean isEarFile(){ 181 return ( m_Type == EAR ); 182 } 183 184 185 189 public boolean isDirectory(){ 190 return ( m_Type == DIR ); 191 } 192 193 194 197 public void setHasEJB(boolean val){ 198 m_HasEJB = val; 199 } 200 201 202 206 public boolean hasEJB(){ 207 return m_HasEJB; 208 } 209 210 public void setType(int m_Type) { 211 this.m_Type = m_Type; 212 } 213 } | Popular Tags |