1 11 package org.eclipse.pde.internal.core.feature; 12 13 import java.io.File ; 14 import java.net.MalformedURLException ; 15 import java.net.URL ; 16 17 import org.eclipse.core.runtime.CoreException; 18 import org.eclipse.pde.internal.core.NLResourceHelper; 19 20 public class ExternalFeatureModel extends AbstractFeatureModel { 21 private static final long serialVersionUID = 1L; 22 private String location; 23 26 protected void updateTimeStamp() { 27 } 28 29 32 public boolean isInSync() { 33 return true; 34 } 35 36 public boolean isEditable() { 37 return false; 38 } 39 40 43 public void load() throws CoreException { 44 } 45 46 public void setInstallLocation(String location) { 47 this.location = location; 48 } 49 public String getInstallLocation() { 50 return location; 51 } 52 53 protected NLResourceHelper createNLResourceHelper() { 54 if (location != null) { 55 URL url = getNLLookupLocation(); 56 return new NLResourceHelper("feature", new URL [] { url }); } 58 return null; 59 } 60 61 public URL getNLLookupLocation() { 62 try { 63 if (location != null && new File (location).isDirectory() && !location.endsWith("/")) return new URL ("file:" + location + "/"); return new URL ("file:" + location); } catch (MalformedURLException e) { 67 return null; 68 } 69 } 70 71 } 72 | Popular Tags |