1 23 24 package com.sun.enterprise.appclient.jws; 25 26 import com.sun.enterprise.deployment.Application; 27 import com.sun.enterprise.deployment.ApplicationClientDescriptor; 28 import com.sun.enterprise.deployment.interfaces.DeploymentImplConstants; 29 import com.sun.enterprise.deployment.util.ModuleDescriptor; 30 import com.sun.enterprise.instance.BaseManager; 31 import java.io.File ; 32 import java.io.FileNotFoundException ; 33 import java.io.IOException ; 34 import java.net.URI ; 35 import java.net.URISyntaxException ; 36 37 42 43 public class AppclientContentOrigin extends UserContentOrigin { 44 45 46 private String contextRoot; 47 48 49 protected ModuleDescriptor moduleDescriptor; 50 51 59 public AppclientContentOrigin(Application application, ModuleDescriptor moduleDescriptor, String contextRoot) { 60 super(application); 61 this.moduleDescriptor = moduleDescriptor; 62 63 68 if (contextRoot.length() < 2 || ( ! contextRoot.substring(0,1).equals("/") )) { 69 String regName = application.getRegistrationName(); 70 throw new IllegalArgumentException ("Java Web Start-related context root of '" + contextRoot + "' specified for app client " + regName + " must begin with a slash and contain at least one other character"); 71 } 72 this.contextRoot = contextRoot; 73 } 74 75 79 public String getContextRoot() { 80 return contextRoot; 81 } 82 83 87 public String getDisplayName() { 88 return moduleDescriptor.getDescriptor().getDisplayName(); 89 } 90 91 95 public String getDescription() { 96 return getApplication().getDescription(); 97 } 98 99 104 public String getAppclientJarPath() { 105 return NamingConventions.TopLevelAppclient.appclientJarPath(this); 106 } 107 108 109 protected String getContentKeyPrefix() { 110 return NamingConventions.TopLevelAppclient.contentKeyPrefix(this); 111 } 112 113 118 protected String getTargetPath() { 119 return NamingConventions.TopLevelAppclient.actualContextRoot(application); 120 } 121 122 128 public String getVirtualPath() { 129 return NamingConventions.TopLevelAppclient.virtualContextRoot(application, moduleDescriptor); 130 } 131 132 public String toString() { 133 return super.toString() + ", context root=" + getVirtualPath() + ", module name=" + moduleDescriptor.getName(); 134 } 135 136 public String getVendor() { 137 return ((ApplicationClientDescriptor) moduleDescriptor.getDescriptor()).getJavaWebStartAccessDescriptor().getVendor(); 138 } 139 140 public String getName() { 141 return application.getRegistrationName(); 142 } 143 } 144 | Popular Tags |