1 19 20 package org.netbeans.modules.tomcat5; 21 22 import javax.enterprise.deploy.spi.Target ; 23 import javax.enterprise.deploy.spi.TargetModuleID ; 24 25 29 public final class TomcatModule implements TargetModuleID { 30 31 private TomcatTarget target; 32 33 private final String path; 34 private final String docRoot; 35 36 public TomcatModule (Target target, String path) { 37 this(target, path, null); 38 } 39 40 public TomcatModule (Target target, String path, String docRoot) { 41 this.target = (TomcatTarget) target; 42 this.path = "".equals(path) ? "/" : path; this.docRoot = docRoot; 45 } 46 47 public String getDocRoot () { 48 return docRoot; 49 } 50 51 public TargetModuleID [] getChildTargetModuleID () { 52 return null; 53 } 54 55 public String getModuleID () { 56 return getWebURL (); 57 } 58 59 public TargetModuleID getParentTargetModuleID () { 60 return null; 61 } 62 63 public Target getTarget () { 64 return target; 65 } 66 67 68 public String getPath () { 69 return path; 70 } 71 72 public String getWebURL () { 74 return target.getServerUri () + path.replaceAll(" ", "%20"); 75 } 82 83 public String toString () { 84 return getModuleID (); 85 } 86 } 87 | Popular Tags |