public void load(URL source, String serviceName) throws IOException { load(source,serviceName,source.openStream()); }
public void load(URL source, String serviceName) throws IOException { load(source,serviceName,source.openStream()); }
public void load(URL source, String serviceName, InputStream is) throws IOException { Entry e = entries.get(serviceName); if(e==null) { e = new Entry(); entries.put(serviceName,e); e.load(source,is); } else { is.close(); } }
public void load(URL source, String serviceName, InputStream is) throws IOException { Entry e = entries.get(serviceName); if(e==null) { e = new Entry(); entries.put(serviceName,e); e.load(source,is); } else { is.close(); } }
private void parseServiceDescriptors(ModuleMetadata result) { /* * This optimisation was earlier not working because of FELIX-1210. */ if (b.getEntry(SERVICE_LOCATION) == null) return; Enumeration<String> entries; entries = b.getEntryPaths(SERVICE_LOCATION); if (entries != null) { while (entries.hasMoreElements()) { String entry = entries.nextElement(); String serviceName = entry.substring(SERVICE_LOCATION.length()+1); InputStream is = null; final URL url = b.getEntry(entry); try { is = url.openStream(); result.load(url, serviceName, is); } catch (IOException e) { LogHelper.getDefaultLogger().log(Level.SEVERE, "Error reading service provider in " + b.getLocation(), e); } finally { if (is != null) { try { is.close(); } catch (IOException e) {} } } } } }
private void parseServiceDescriptors(ModuleMetadata result) { /* * This optimisation was earlier not working because of FELIX-1210. */ if (b.getEntry(SERVICE_LOCATION) == null) return; Enumeration<String> entries; entries = b.getEntryPaths(SERVICE_LOCATION); if (entries != null) { while (entries.hasMoreElements()) { String entry = entries.nextElement(); String serviceName = entry.substring(SERVICE_LOCATION.length()+1); InputStream is = null; final URL url = b.getEntry(entry); try { is = url.openStream(); result.load(url, serviceName, is); } catch (IOException e) { LogHelper.getDefaultLogger().log(Level.SEVERE, "Error reading service provider in " + b.getLocation(), e); } finally { if (is != null) { try { is.close(); } catch (IOException e) {} } } } } }