Author: meerajk
Date: Thu Sep 21 13:59:13 2006
New Revision: 448682
URL: http://svn.apache.org/viewvc?view=rev&rev=448682
Log:
Added base URL.
Modified:
incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/launcher/LauncherRuntimeInfo.java
Modified:
incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/launcher/LauncherRuntimeInfo.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/launcher/LauncherRuntimeInfo.java?view=diff&rev=448682&r1=448681&r2=448682
==============================================================================
---
incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/launcher/LauncherRuntimeInfo.java
(original)
+++
incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/launcher/LauncherRuntimeInfo.java
Thu Sep 21 13:59:13 2006
@@ -19,6 +19,8 @@
package org.apache.tuscany.core.launcher;
import java.io.File;
+import java.net.MalformedURLException;
+import java.net.URL;
import org.apache.tuscany.spi.services.info.RuntimeInfo;
@@ -26,19 +28,54 @@
* @version $Rev$ $Date$
*/
public class LauncherRuntimeInfo implements RuntimeInfo {
+
+ /** Install directory */
private final File installDirectory;
+
+ /** Application root directory */
private final File applicationRootDirectory;
+ /**
+ * Initializes the installation and application root directories.
+ *
+ * @param installDirectory Installation directory.
+ * @param applicationRootDirectory Application root directory.
+ */
public LauncherRuntimeInfo(File installDirectory, File
applicationRootDirectory) {
this.installDirectory = installDirectory;
this.applicationRootDirectory = applicationRootDirectory;
}
-
+
+ /**
+ * Return the directory where the running runtime was installed.
+ *
+ * @return the directory where the runtime was installed
+ */
public File getInstallDirectory() {
return installDirectory;
}
+ /**
+ * Return the root directory used to resolve application file paths.
+ *
+ * @return the directory used to resolve application file paths.
+ */
public File getApplicationRootDirectory() {
return applicationRootDirectory;
}
+
+ /**
+ * Gets the base URL for the runtime.
+ *
+ * @return The base URL for the runtime.
+ */
+ public URL getBaseURL() {
+ try {
+ return getInstallDirectory().toURL();
+ } catch (MalformedURLException e) {
+ // TODO Decide on how to handle the exception
+ throw new RuntimeException(e);
+ }
+ }
+
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]