1 package org
.argeo
.slc
.support
.deploy
;
4 import java
.net
.MalformedURLException
;
7 import org
.argeo
.slc
.SlcException
;
8 import org
.argeo
.slc
.deploy
.TargetData
;
10 public class HttpdApplicationTargetData
implements TargetData
{
11 private HttpdServer webServer
;
12 private String relativePath
;
13 private String targetRootPath
;
15 public HttpdServer
getWebServer() {
19 public void setWebServer(HttpdServer webServer
) {
20 this.webServer
= webServer
;
23 public String
getRelativePath() {
28 * If targetRootLocation not set, used to build the targetRootLocation,
29 * relative to the webserver base.
31 public void setRelativePath(String relativePath
) {
32 this.relativePath
= relativePath
;
35 public String
getTargetRootPath() {
36 return targetRootPath
;
39 public void setTargetRootPath(String targetRootPath
) {
40 this.targetRootPath
= targetRootPath
;
43 public URL
getTargetBaseUrl() {
45 URL wsUrl
= getWebServer().getBaseUrl();
47 return new URL(wsUrl
, wsUrl
.getFile() + '/' + relativePath
);
48 } catch (MalformedURLException e
) {
49 throw new SlcException("Cannot get base url for " + relativePath
, e
);
53 public File
getTargetRootLocation() {
54 if (targetRootPath
!= null && !targetRootPath
.equals("")) {
55 return new File(targetRootPath
);
57 HttpdServerTargetData targetData
= (HttpdServerTargetData
) getWebServer()
59 String path
= targetData
.getServerRoot() + File
.separator
61 return new File(path
);