1 11 package org.eclipse.core.runtime.preferences; 12 13 import java.net.URL ; 14 import org.eclipse.core.internal.preferences.AbstractScope; 15 import org.eclipse.core.internal.preferences.PreferencesOSGiUtils; 16 import org.eclipse.core.runtime.IPath; 17 import org.eclipse.core.runtime.Path; 18 import org.eclipse.osgi.service.datalocation.Location; 19 20 42 public final class ConfigurationScope extends AbstractScope implements IScopeContext { 43 44 48 public static final String SCOPE = "configuration"; 50 53 public ConfigurationScope() { 54 super(); 55 } 56 57 60 public String getName() { 61 return SCOPE; 62 } 63 64 67 public IEclipsePreferences getNode(String qualifier) { 68 return super.getNode(qualifier); 69 } 70 71 74 public IPath getLocation() { 75 IPath result = null; 76 Location location = PreferencesOSGiUtils.getDefault().getConfigurationLocation(); 77 if (!location.isReadOnly()) { 78 URL url = location.getURL(); 79 if (url != null) { 80 result = new Path(url.getFile()); 81 if (result.isEmpty()) 82 result = null; 83 } 84 } 85 return result; 86 } 87 } 88 | Popular Tags |