1 23 24 package com.sun.enterprise.appclient.jws; 25 26 import java.io.File ; 27 import java.net.URI ; 28 29 34 public class StaticContent extends Content { 35 36 37 private URI relativeURI; 38 39 42 private boolean isMainJarFile; 43 44 53 public StaticContent(ContentOrigin origin, String contentKey, String path, File file, URI installRootURI, boolean isMainJarFile) { 54 super(origin, contentKey, path); 55 URI fileURI = file.toURI(); 56 relativeURI = installRootURI.relativize(fileURI); 57 this.isMainJarFile = isMainJarFile; 58 } 59 60 63 public URI getRelativeURI() { 64 return relativeURI; 65 } 66 67 70 public String toString() { 71 String result = super.toString() + ", relative URI=" + getRelativeURI() + ", isMain=" + isMainJarFile; 72 return result; 73 } 74 75 79 public String getMainExpr() { 80 String result; 81 if (isMainJarFile) { 82 result = " main=\"true\""; 83 } else { 84 result = ""; 85 } 86 return result; 87 } 88 89 94 public String asJNLPJarElement() { 95 String fullPath = "${request.scheme}://${request.host}:${request.port}" + 96 NamingConventions.fullJarPath(getContentKey()); 97 98 return " <jar HREF=\"" + fullPath + "\" " + getMainExpr() + "/>" + lineSep; 99 } 100 } 101 | Popular Tags |