@Test public void testLoadOverrides() { Set<String> overrides = Overrides.loadOverrides(getClass().getResource("overrides.properties").toExternalForm()); assertEquals(2, overrides.size()); Clause karafAdminCommand = null; Clause karafAdminCore = null; for (Clause clause : Parser.parseClauses(overrides.toArray(new String[overrides.size()]))) { if (clause.getName().equals("mvn:org.apache.karaf.admin/org.apache.karaf.admin.command/2.3.0.61033X")) { karafAdminCommand = clause; } if (clause.getName().equals("mvn:org.apache.karaf.admin/org.apache.karaf.admin.core/2.3.0.61033X")) { karafAdminCore = clause; } } assertNotNull("Missing admin.command bundle override", karafAdminCommand); assertNotNull("Missing admin.core bundle override", karafAdminCore); assertNotNull("Missing range on admin.core override", karafAdminCore.getAttribute(Overrides.OVERRIDE_RANGE)); }
public static Set<String> loadOverrides(String overridesUrl) { Set<String> overrides = new LinkedHashSet<>(); try { if (overridesUrl != null) { try ( InputStream is = new URL(overridesUrl).openStream(); BufferedReader reader = new BufferedReader(new InputStreamReader(is)) ) { String line; while ((line = reader.readLine()) != null) { line = line.trim(); if (!line.isEmpty() && !line.startsWith("#")) { overrides.add(line); } } } } } catch (FileNotFoundException e) { LOGGER.debug("Unable to load overrides bundles list {}", e.toString()); } catch (Exception e) { LOGGER.debug("Unable to load overrides bundles list", e); } return overrides; }
Overrides { public static Set<String> loadOverrides(String overridesUrl) { Set<String> overrides = new LinkedHashSet<>(); try { if (overridesUrl != null) { try ( InputStream is = new URL(overridesUrl).openStream(); BufferedReader reader = new BufferedReader(new InputStreamReader(is)) ) { String line; while ((line = reader.readLine()) != null) { line = line.trim(); if (!line.isEmpty() && !line.startsWith("#")) { overrides.add(line); } } } } } catch (FileNotFoundException e) { LOGGER.debug("Unable to load overrides bundles list {}", e.toString()); } catch (Exception e) { LOGGER.debug("Unable to load overrides bundles list", e); } return overrides; } }
Overrides { public static Set<String> loadOverrides(String overridesUrl) { Set<String> overrides = new LinkedHashSet<>(); try { if (overridesUrl != null) { try ( InputStream is = new URL(overridesUrl).openStream(); BufferedReader reader = new BufferedReader(new InputStreamReader(is)) ) { String line; while ((line = reader.readLine()) != null) { line = line.trim(); if (!line.isEmpty() && !line.startsWith("#")) { overrides.add(line); } } } } } catch (FileNotFoundException e) { LOGGER.debug("Unable to load overrides bundles list {}", e.toString()); } catch (Exception e) { LOGGER.debug("Unable to load overrides bundles list", e); } return overrides; } private  Overrides(); }
Overrides { public static Set<String> loadOverrides(String overridesUrl) { Set<String> overrides = new LinkedHashSet<>(); try { if (overridesUrl != null) { try ( InputStream is = new URL(overridesUrl).openStream(); BufferedReader reader = new BufferedReader(new InputStreamReader(is)) ) { String line; while ((line = reader.readLine()) != null) { line = line.trim(); if (!line.isEmpty() && !line.startsWith("#")) { overrides.add(line); } } } } } catch (FileNotFoundException e) { LOGGER.debug("Unable to load overrides bundles list {}", e.toString()); } catch (Exception e) { LOGGER.debug("Unable to load overrides bundles list", e); } return overrides; } private  Overrides(); @Deprecated static void override(Map<String, T> resources, Collection<String> overrides); static void override(Map<String, T> resources, Map<String, T> overridenFrom); static Set<String> loadOverrides(String overridesUrl); static String extractUrl(String override); }
Overrides { public static Set<String> loadOverrides(String overridesUrl) { Set<String> overrides = new LinkedHashSet<>(); try { if (overridesUrl != null) { try ( InputStream is = new URL(overridesUrl).openStream(); BufferedReader reader = new BufferedReader(new InputStreamReader(is)) ) { String line; while ((line = reader.readLine()) != null) { line = line.trim(); if (!line.isEmpty() && !line.startsWith("#")) { overrides.add(line); } } } } } catch (FileNotFoundException e) { LOGGER.debug("Unable to load overrides bundles list {}", e.toString()); } catch (Exception e) { LOGGER.debug("Unable to load overrides bundles list", e); } return overrides; } private  Overrides(); @Deprecated static void override(Map<String, T> resources, Collection<String> overrides); static void override(Map<String, T> resources, Map<String, T> overridenFrom); static Set<String> loadOverrides(String overridesUrl); static String extractUrl(String override); static final String OVERRIDE_RANGE; }