/** * Creates a new instance of {@linkplain ExtensionsRepository} which is a result of composition of other repositories * @param location Desired execution {@linkplain ExtensionsRepository.Location} * @param reps The repositories to wrap in composite * @return Returns a new instance of {@linkplain ExtensionsRepository} */ public static ExtensionsRepository composite(ExtensionsRepository.Location location, ExtensionsRepository ... reps) { Set<String> paths = new HashSet<String>(); StringBuilder sb = new StringBuilder(); for(ExtensionsRepository rep : reps) { if (location == ExtensionsRepository.Location.BOTH || location == rep.getLocation()) { String ePath = rep.getExtensionsPath(); if (ePath != null) { paths.add(ePath); } } } for(String path : paths) { if (sb.length() > 0) { sb.append(File.pathSeparatorChar); } sb.append(path); } return fixed(location, sb.toString()); } }
/** * Creates a new instance of {@linkplain ExtensionsRepository} which is a result of composition of other repositories * @param location Desired execution {@linkplain ExtensionsRepository.Location} * @param reps The repositories to wrap in composite * @return Returns a new instance of {@linkplain ExtensionsRepository} */ public static ExtensionsRepository composite(ExtensionsRepository.Location location, ExtensionsRepository ... reps) { Set<String> paths = new HashSet<String>(); StringBuilder sb = new StringBuilder(); for(ExtensionsRepository rep : reps) { if (location == ExtensionsRepository.Location.BOTH || location == rep.getLocation()) { String ePath = rep.getExtensionsPath(); if (ePath != null) { paths.add(ePath); } } } for(String path : paths) { if (sb.length() > 0) { sb.append(File.pathSeparatorChar); } sb.append(path); } return fixed(location, sb.toString()); } }