1 11 package org.eclipse.core.runtime; 12 13 import java.io.IOException ; 14 import java.io.InputStream ; 15 import java.net.URL ; 16 import java.util.Map ; 17 import org.eclipse.core.internal.runtime.Activator; 18 import org.eclipse.core.internal.runtime.FindSupport; 19 import org.eclipse.osgi.service.urlconversion.URLConverter; 20 import org.osgi.framework.Bundle; 21 22 30 public final class FileLocator { 31 32 private FileLocator() { 33 } 35 36 85 public static URL find(Bundle bundle, IPath path, Map override) { 86 return FindSupport.find(bundle, path, override); 87 } 88 89 107 public static URL [] findEntries(Bundle bundle, IPath path, Map override) { 108 return FindSupport.findEntries(bundle, path, override); 109 } 110 111 123 public static URL [] findEntries(Bundle bundle, IPath path) { 124 return FindSupport.findEntries(bundle, path); 125 } 126 127 145 public static InputStream openStream(Bundle bundle, IPath file, boolean substituteArgs) throws IOException { 146 return FindSupport.openStream(bundle, file, substituteArgs); 147 } 148 149 162 public static URL toFileURL(URL url) throws IOException { 163 URLConverter converter = Activator.getURLConverter(url); 164 return converter == null ? url : converter.toFileURL(url); 165 } 166 167 184 public static URL resolve(URL url) throws IOException { 185 URLConverter converter = Activator.getURLConverter(url); 186 return converter == null ? url : converter.resolve(url); 187 } 188 189 } 190 | Popular Tags |