コード例 #1
0
 /*
  * Helper method to return the install location. Return null if it is unavailable.
  */
 public static File getInstallLocation() {
   Location installLocation =
       ServiceHelper.getService(
           TestActivator.getContext(), Location.class, Location.INSTALL_FILTER);
   if (installLocation == null || !installLocation.isSet()) return null;
   URL url = installLocation.getURL();
   if (url == null) return null;
   return URLUtil.toFile(url);
 }
コード例 #2
0
ファイル: Util.java プロジェクト: mickaelistria/rt.equinox.p2
 /*
  * Helper method to return the eclipse.home location. Return
  * null if it is unavailable.
  */
 public static File getEclipseHome() {
   Location eclipseHome =
       (Location)
           ServiceHelper.getService(
               Activator.getContext(), Location.class.getName(), Location.ECLIPSE_HOME_FILTER);
   if (eclipseHome == null || !eclipseHome.isSet()) return null;
   URL url = eclipseHome.getURL();
   if (url == null) return null;
   return URLUtil.toFile(url);
 }