Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGianMaria Romanato2016-02-07 16:12:53 -0500
committerGianMaria Romanato2016-02-07 16:14:22 -0500
commitec9729967c9285a6469b812f9594022f36816e88 (patch)
treeb408af924a43c2bf423d1e18065ca6c6ace8c5b9
parentd86d000e9d92829f5abb30c656447cb31c8842c0 (diff)
downloadorg.eclipse.virgo.ide-support-java-7-profile.tar.gz
org.eclipse.virgo.ide-support-java-7-profile.tar.xz
org.eclipse.virgo.ide-support-java-7-profile.zip
Add support for Virgo 3.7support-java-7-profile
- Consume the latest org.eclipse.virgo.kernel-tools as a binary nested JAR inside org.eclipse.virgo.ide.manifest.core lib folder. - Change Virgo37Provider to detect runtime version via $VIRGO_HOME/lib/.version file and to assume that the java profile file is now named java-server.profile
-rw-r--r--org.eclipse.virgo.ide.manifest.core/lib/org.eclipse.virgo.kernel.tools-sources.jarbin37544 -> 37614 bytes
-rw-r--r--org.eclipse.virgo.ide.manifest.core/lib/org.eclipse.virgo.kernel.tools.jarbin50065 -> 50083 bytes
-rw-r--r--org.eclipse.virgo.ide.runtime.core/src/org/eclipse/virgo/ide/runtime/internal/core/runtimes/Virgo37Provider.java45
3 files changed, 43 insertions, 2 deletions
diff --git a/org.eclipse.virgo.ide.manifest.core/lib/org.eclipse.virgo.kernel.tools-sources.jar b/org.eclipse.virgo.ide.manifest.core/lib/org.eclipse.virgo.kernel.tools-sources.jar
index e1ccd7e..3b574b4 100644
--- a/org.eclipse.virgo.ide.manifest.core/lib/org.eclipse.virgo.kernel.tools-sources.jar
+++ b/org.eclipse.virgo.ide.manifest.core/lib/org.eclipse.virgo.kernel.tools-sources.jar
Binary files differ
diff --git a/org.eclipse.virgo.ide.manifest.core/lib/org.eclipse.virgo.kernel.tools.jar b/org.eclipse.virgo.ide.manifest.core/lib/org.eclipse.virgo.kernel.tools.jar
index edfbf7a..b2c142a 100644
--- a/org.eclipse.virgo.ide.manifest.core/lib/org.eclipse.virgo.kernel.tools.jar
+++ b/org.eclipse.virgo.ide.manifest.core/lib/org.eclipse.virgo.kernel.tools.jar
Binary files differ
diff --git a/org.eclipse.virgo.ide.runtime.core/src/org/eclipse/virgo/ide/runtime/internal/core/runtimes/Virgo37Provider.java b/org.eclipse.virgo.ide.runtime.core/src/org/eclipse/virgo/ide/runtime/internal/core/runtimes/Virgo37Provider.java
index 9b3a7fd..211f11f 100644
--- a/org.eclipse.virgo.ide.runtime.core/src/org/eclipse/virgo/ide/runtime/internal/core/runtimes/Virgo37Provider.java
+++ b/org.eclipse.virgo.ide.runtime.core/src/org/eclipse/virgo/ide/runtime/internal/core/runtimes/Virgo37Provider.java
@@ -11,12 +11,20 @@
package org.eclipse.virgo.ide.runtime.internal.core.runtimes;
+import java.io.File;
+import java.io.FileInputStream;
+import java.util.Properties;
+
+import org.eclipse.core.runtime.IPath;
import org.eclipse.virgo.ide.runtime.core.IServerBehaviour;
import org.eclipse.virgo.ide.runtime.core.IServerRuntimeProvider;
import org.eclipse.virgo.ide.runtime.internal.core.DeploymentIdentity;
import org.eclipse.virgo.ide.runtime.internal.core.command.IServerCommand;
import org.eclipse.virgo.ide.runtime.internal.core.command.JmxServerDeployCommand;
+import org.eclipse.virgo.util.io.IOUtils;
import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.IRuntime;
+import org.osgi.framework.Version;
/**
* {@link IServerRuntimeProvider} for Virgo Server 3.7.0 and above.
@@ -32,13 +40,46 @@ public class Virgo37Provider extends Virgo35Provider {
}
@Override
+ public boolean isHandlerFor(IRuntime runtime) {
+ IPath libPath = runtime.getLocation().append("lib"); //$NON-NLS-1$
+ File libDir = libPath.toFile();
+ if (libDir.exists()) {
+ IPath versionFilePath = libPath.append(".version"); //$NON-NLS-1$
+ File versionFile = versionFilePath.toFile();
+ if (versionFile.exists()) {
+ String version = (String) readVersionFile(versionFile).get("virgo.server.version"); //$NON-NLS-1$
+ if (version != null) {
+ Version ver = Version.parseVersion(version);
+ return (ver.getMajor() == 3 && ver.getMinor() >= 7);
+ }
+ }
+ return false;
+ }
+ return false;
+ }
+
+ private Properties readVersionFile(File versionFile) {
+ Properties props = new Properties();
+ FileInputStream fis = null;
+ try {
+ fis = new FileInputStream(versionFile);
+ props.load(fis);
+ } catch (Exception e) {
+ // ignore
+ } finally {
+ IOUtils.closeQuietly(fis);
+ }
+ return props;
+ }
+
+ @Override
protected String getServerProfileName() {
- return "java7-server.profile";
+ return "java-server.profile"; //$NON-NLS-1$
}
@Override
public String getSupportedVersions() {
- return "3.7+";
+ return "3.7+"; //$NON-NLS-1$
}
/*

Back to the top