-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.support.deploy;\r
-\r
-import java.io.File;\r
-import java.net.MalformedURLException;\r
-import java.net.URL;\r
-\r
-import org.argeo.slc.SlcException;\r
-import org.argeo.slc.deploy.TargetData;\r
-\r
-public class HttpdApplicationTargetData implements TargetData {\r
- private HttpdServer webServer;\r
- private String relativePath;\r
- private String targetRootPath;\r
-\r
- public HttpdServer getWebServer() {\r
- return webServer;\r
- }\r
-\r
- public void setWebServer(HttpdServer webServer) {\r
- this.webServer = webServer;\r
- }\r
-\r
- public String getRelativePath() {\r
- return relativePath;\r
- }\r
-\r
- /**\r
- * If targetRootLocation not set, used to build the targetRootLocation,\r
- * relative to the webserver base.\r
- */\r
- public void setRelativePath(String relativePath) {\r
- this.relativePath = relativePath;\r
- }\r
-\r
- public String getTargetRootPath() {\r
- return targetRootPath;\r
- }\r
-\r
- public void setTargetRootPath(String targetRootPath) {\r
- this.targetRootPath = targetRootPath;\r
- }\r
-\r
- public URL getTargetBaseUrl() {\r
- try {\r
- URL wsUrl = getWebServer().getBaseUrl();\r
- // TODO: use URI\r
- return new URL(wsUrl, wsUrl.getFile() + '/' + relativePath);\r
- } catch (MalformedURLException e) {\r
- throw new SlcException("Cannot get base url for " + relativePath, e);\r
- }\r
- }\r
-\r
- public File getTargetRootLocation() {\r
- if (targetRootPath != null && !targetRootPath.equals("")) {\r
- return new File(targetRootPath);\r
- } else {\r
- HttpdServerTargetData targetData = (HttpdServerTargetData) getWebServer()\r
- .getTargetData();\r
- String path = targetData.getServerRoot() + File.separator\r
- + getRelativePath();\r
- return new File(path);\r
- }\r
- }\r
-\r
-}\r
+package org.argeo.slc.support.deploy;
+
+import java.io.File;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import org.argeo.slc.SlcException;
+import org.argeo.slc.deploy.TargetData;
+
+public class HttpdApplicationTargetData implements TargetData {
+ private HttpdServer webServer;
+ private String relativePath;
+ private String targetRootPath;
+
+ public HttpdServer getWebServer() {
+ return webServer;
+ }
+
+ public void setWebServer(HttpdServer webServer) {
+ this.webServer = webServer;
+ }
+
+ public String getRelativePath() {
+ return relativePath;
+ }
+
+ /**
+ * If targetRootLocation not set, used to build the targetRootLocation,
+ * relative to the webserver base.
+ */
+ public void setRelativePath(String relativePath) {
+ this.relativePath = relativePath;
+ }
+
+ public String getTargetRootPath() {
+ return targetRootPath;
+ }
+
+ public void setTargetRootPath(String targetRootPath) {
+ this.targetRootPath = targetRootPath;
+ }
+
+ public URL getTargetBaseUrl() {
+ try {
+ URL wsUrl = getWebServer().getBaseUrl();
+ // TODO: use URI
+ return new URL(wsUrl, wsUrl.getFile() + '/' + relativePath);
+ } catch (MalformedURLException e) {
+ throw new SlcException("Cannot get base url for " + relativePath, e);
+ }
+ }
+
+ public File getTargetRootLocation() {
+ if (targetRootPath != null && !targetRootPath.equals("")) {
+ return new File(targetRootPath);
+ } else {
+ HttpdServerTargetData targetData = (HttpdServerTargetData) getWebServer()
+ .getTargetData();
+ String path = targetData.getServerRoot() + File.separator
+ + getRelativePath();
+ return new File(path);
+ }
+ }
+
+}