diff options
author | Pascal Rapicault | 2015-03-10 01:35:06 +0000 |
---|---|---|
committer | Pascal Rapicault | 2015-03-10 01:35:06 +0000 |
commit | 721e1e1dcbbb41f8a19547c6e7244dc0d68ef9f9 (patch) | |
tree | 9f417677384780d24ec085ea7ae5ba81544f6671 /bundles | |
parent | a950b80445e04dc41a3f7364b0ac0074c9b21b5a (diff) | |
download | rt.equinox.framework-721e1e1dcbbb41f8a19547c6e7244dc0d68ef9f9.tar.gz rt.equinox.framework-721e1e1dcbbb41f8a19547c6e7244dc0d68ef9f9.tar.xz rt.equinox.framework-721e1e1dcbbb41f8a19547c6e7244dc0d68ef9f9.zip |
Fix Eclipse home location computation for Mac new layoutI20150317-2000I20150317-1130I20150317-0800I20150316-2000I20150316-0800I20150315-2000I20150311-1300I20150310-0800
Diffstat (limited to 'bundles')
-rw-r--r-- | bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/location/EquinoxLocations.java | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/location/EquinoxLocations.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/location/EquinoxLocations.java index c9efa45c8..a39cc26d9 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/location/EquinoxLocations.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/location/EquinoxLocations.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2012 IBM Corporation and others. + * Copyright (c) 2004, 2015 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -7,6 +7,7 @@ * * Contributors: * IBM Corporation - initial API and implementation + * Rapicorp, Inc - Support for Mac Layout (bug 431116) *******************************************************************************/ package org.eclipse.osgi.internal.location; @@ -151,21 +152,14 @@ public class EquinoxLocations { // check for mac os; the os check is copied from EclipseEnvironmentInfo. String macosx = org.eclipse.osgi.service.environment.Constants.OS_MACOSX; if (macosx.equals(equinoxConfig.getOS())) - launcherDir = getMacOSEclipsoeHomeLocation(launcherDir); + launcherDir = getMacOSEclipseHomeLocation(launcherDir); return (launcherDir.exists() && launcherDir.isDirectory()) ? launcherDir.getAbsolutePath() : null; } - private static File getMacOSEclipsoeHomeLocation(File launcherDir) { - // TODO for now we go up three directories from the launcher dir as long as the parent dir is named MacOS; is this always the case? - // TODO not sure if case is important + private static File getMacOSEclipseHomeLocation(File launcherDir) { if (!launcherDir.getName().equalsIgnoreCase("macos")) //$NON-NLS-1$ return launcherDir; // don't do the up three stuff if not in macos directory - String launcherParent = launcherDir.getParent(); - if (launcherParent != null) - launcherParent = new File(launcherParent).getParent(); - if (launcherParent != null) - launcherParent = new File(launcherParent).getParent(); - return launcherParent == null ? null : new File(launcherParent); + return new File(launcherDir.getParent(), "Eclipse"); //$NON-NLS-1$ } @SuppressWarnings("deprecation") |