]> git.argeo.org Git - gpl/argeo-slc.git/blob - org.argeo.slc.core/src/main/java/org/argeo/slc/support/deploy/HttpdApplicationTargetData.java
Improve auto-detection of Spring beans.
[gpl/argeo-slc.git] / org.argeo.slc.core / src / main / java / org / argeo / slc / support / deploy / HttpdApplicationTargetData.java
1 package org.argeo.slc.support.deploy;
2
3 import java.io.File;
4 import java.net.MalformedURLException;
5 import java.net.URL;
6
7 import org.argeo.slc.core.SlcException;
8 import org.argeo.slc.core.deploy.TargetData;
9
10 public class HttpdApplicationTargetData implements TargetData {
11 private ApacheHttpdServer webServer;
12 private String relativePath;
13
14 public ApacheHttpdServer getWebServer() {
15 return webServer;
16 }
17
18 public void setWebServer(ApacheHttpdServer webServer) {
19 this.webServer = webServer;
20 }
21
22 public String getRelativePath() {
23 return relativePath;
24 }
25
26 public void setRelativePath(String relativePath) {
27 this.relativePath = relativePath;
28 }
29
30 public URL getTargetBaseUrl() {
31 try {
32 URL wsUrl = getWebServer().getBaseUrl();
33 return new URL(wsUrl, wsUrl.getFile() + '/' + relativePath);
34 } catch (MalformedURLException e) {
35 throw new SlcException("Cannot get base url for " + relativePath, e);
36 }
37 }
38
39 public File getTargetRootLocation() {
40 return new File(getWebServer().getBaseLocation().getPath()
41 + File.separator + getRelativePath());
42 }
43
44 }