1 12 package org.eclipse.ant.internal.core; 13 14 import java.io.File ; 15 import java.net.URL ; 16 17 import org.eclipse.ant.core.AntCorePlugin; 18 import org.eclipse.ant.core.IAntPropertyValueProvider; 19 import org.eclipse.core.runtime.FileLocator; 20 21 35 public class AntPropertyValueProvider implements IAntPropertyValueProvider { 36 43 public String getAntPropertyValue(String propertyName) { 44 String value = null; 45 if ("eclipse.running".equals(propertyName)){ return "true"; } else if ("eclipse.home".equals(propertyName)) { try { 49 value = new File (FileLocator.resolve(new URL ("platform:/base/")).getPath()).getAbsolutePath(); if (value.endsWith("/")) { value = value.substring(0, value.length() - 1); 52 } 53 } catch (Exception e) { 54 AntCorePlugin.log(e); 55 } 56 } 57 return value; 58 } 59 } | Popular Tags |