1 23 24 package com.sun.enterprise.appclient.jws; 25 26 import com.sun.enterprise.deployment.Application; 27 import com.sun.enterprise.deployment.interfaces.DeploymentImplConstants; 28 import com.sun.enterprise.deployment.util.ModuleDescriptor; 29 import com.sun.enterprise.instance.BaseManager; 30 import java.io.File ; 31 import java.io.FileNotFoundException ; 32 import java.io.IOException ; 33 import java.net.URI ; 34 35 41 public abstract class UserContentOrigin extends ContentOrigin { 42 43 44 protected Application application; 45 46 50 public UserContentOrigin(Application application) { 51 super(); 52 this.application = application; 53 } 54 55 63 public String getTopLevelRegistrationName() { 64 return getApplication().getRegistrationName(); 65 } 66 67 71 public String toString() { 72 StringBuilder sb = new StringBuilder (super.toString()); 73 sb.append(" registration name=").append(application.getRegistrationName()); 74 return sb.toString(); 76 } 77 78 82 public Application getApplication() { 83 return application; 84 } 85 86 91 public File locateGeneratedAppclientJarFile(BaseManager mgr) throws FileNotFoundException { 92 String regName = application.getRegistrationName(); 93 94 String generatedAppClientJarDirSpec = mgr.getGeneratedXMLLocation(regName); 95 String generatedAppClientJarName = getTopLevelRegistrationName() + DeploymentImplConstants.ClientJarSuffix; 96 97 File generatedAppClientJar = new File (generatedAppClientJarDirSpec, generatedAppClientJarName); 98 if ( ! generatedAppClientJar.exists()) { 99 throw new FileNotFoundException (generatedAppClientJar.getAbsolutePath()); 100 } 101 return generatedAppClientJar; 102 } 103 108 public boolean isEnabled() { 109 try { 110 return AppclientJWSSupportInfo.getInstance().isEnabled(this); 111 } catch (IOException ioe) { 112 116 return false; 117 } catch (Exception e) { 118 throw new RuntimeException (e); 119 } 120 } 121 } | Popular Tags |