public Maven getMaven() { if (maven != null) return maven; maven = registry.getPlugin(Maven.class); return maven; }
public Maven getMaven() { if (maven != null) return maven; maven = registry.getPlugin(Maven.class); return maven; }
public Maven getMaven() { if ( maven != null) return maven; maven = registry.getPlugin(Maven.class); return maven; }
public Maven getMaven() { if (maven != null) return maven; maven = registry.getPlugin(Maven.class); return maven; }
public Maven getMaven() { if (maven != null) return maven; maven = registry.getPlugin(Maven.class); return maven; }
public Maven getMaven() { if (maven != null) return maven; maven = registry.getPlugin(Maven.class); return maven; }
private URLConnector getConnector() { URLConnector connector; synchronized (this) { connector = registry != null ? registry.getPlugin(URLConnector.class) : null; } if (connector == null) connector = new DefaultURLConnector(); return connector; }
private void regenerateIndex() throws Exception { BundleIndexer indexer = registry.getPlugin(BundleIndexer.class); if (indexer == null) throw new IllegalStateException("Cannot index repository: no Bundle Indexer service or plugin found."); Set<File> allFiles = new HashSet<File>(); gatherFiles(allFiles); FileOutputStream out = null; try { out = new FileOutputStream(localIndex); if (!allFiles.isEmpty()) { Map<String, String> config = new HashMap<String, String>(); config.put(BundleIndexer.REPOSITORY_NAME, this.getName()); config.put(BundleIndexer.ROOT_URL, localIndex.getCanonicalFile().toURI().toURL().toString()); indexer.index(allFiles, out, config); } else { ByteArrayInputStream emptyRepo = new ByteArrayInputStream("<?xml version='1.0' encoding='UTF-8'?>\n<repository lastmodified='0'/>".getBytes()); IO.copy(emptyRepo, out); } } finally { out.close(); } }
/** * @return the class to use for URL connections. It's retrieved from the * registry under the URLConnector class, or it will be the * DefaultURLConnector if the former was not found. */ private URLConnector getConnector() { URLConnector connector; synchronized (this) { connector = registry != null ? registry.getPlugin(URLConnector.class) : null; } if (connector == null) { DefaultURLConnector defaultConnector = new DefaultURLConnector(); defaultConnector.setRegistry(registry); connector = defaultConnector; } return connector; }
/** * @return the class to use for URL connections. It's retrieved from the * registry under the URLConnector class, or it will be the * DefaultURLConnector if the former was not found. */ private URLConnector getConnector() { URLConnector connector; synchronized (this) { connector = registry != null ? registry.getPlugin(URLConnector.class) : null; } if (connector == null) { DefaultURLConnector defaultConnector = new DefaultURLConnector(); defaultConnector.setRegistry(registry); connector = defaultConnector; } return connector; }
@Override public void setRegistry(Registry registry) { super.setRegistry(registry); Workspace workspace = registry.getPlugin(Workspace.class); SetLocation location = workspace .warning("FixedIndexedRepository is deprecated, please use " + OSGiRepository.class.getName()); location.header("-plugin.*") .context("FixedIndexedRepository"); } }
@Override public void setRegistry(Registry registry) { super.setRegistry(registry); Workspace workspace = registry.getPlugin(Workspace.class); SetLocation location = workspace .warning("FixedIndexedRepository is deprecated, please use " + OSGiRepository.class.getName()); location.header("-plugin.*") .context("FixedIndexedRepository"); } }
P2Indexer getP2Index0() { this.workspace = registry.getPlugin(Workspace.class); HttpClient client = registry.getPlugin(HttpClient.class); URI url = config.url(); if (url == null) throw new IllegalArgumentException("For a p2 repository you must set the url parameter to the repository"); try { name = config.name(client.toName(url)); File location = workspace.getFile(config.location("cnf/cache/p2-" + name)); IO.mkdirs(location); File indexFile = new File(location, "index.xml.gz"); return new P2Indexer(reporter, location, client, url, name); } catch (Exception e) { throw Exceptions.duck(e); } }
P2Indexer getP2Index0() { this.workspace = registry.getPlugin(Workspace.class); HttpClient client = registry.getPlugin(HttpClient.class); URI url = config.url(); if (url == null) throw new IllegalArgumentException("For a p2 repository you must set the url parameter to the repository"); try { name = config.name(client.toName(url)); File location = workspace.getFile(config.location("cnf/cache/p2-" + name)); IO.mkdirs(location); File indexFile = new File(location, "index.xml.gz"); return new P2Indexer(reporter, location, client, url, name); } catch (Exception e) { throw Exceptions.duck(e); } }
@Override public void setProperties(Map<String,String> map) throws Exception { super.setProperties(map); String email = map.get(EMAIL); if (email == null) { Workspace ws = registry.getPlugin(Workspace.class); Settings settings = registry.getPlugin(Settings.class); email = settings.getEmail(); if (email == null) { error("The bnd authentication URL connection handler has no email set as property, nor have the bnd settings been set"); return; } credentials(email, settings.getPublicKey(), settings.getPrivateKey()); } else { String pub = map.get(PUBLIC_KEY); String prv = map.get(PRIVATE_KEY); if (pub == null || !Hex.isHex(pub)) { error("The bnd authentication URL public key for email %s is not a hex string %s", email, pub); return; } if (prv == null || !Hex.isHex(prv)) { error("The bnd authentication URL private key for email %s is not a hex string", email); return; } credentials(email, Hex.toByteArray(pub), Hex.toByteArray(prv)); } machine = map.get(MACHINE); }
@Override public void setProperties(Map<String,String> map) throws Exception { super.setProperties(map); String email = map.get(EMAIL); if (email == null) { Workspace ws = registry.getPlugin(Workspace.class); Settings settings = registry.getPlugin(Settings.class); email = settings.getEmail(); if (email == null) { error("The bnd authentication URL connection handler has no email set as property, nor have the bnd settings been set"); return; } credentials(email, settings.getPublicKey(), settings.getPrivateKey()); } else { String pub = map.get(PUBLIC_KEY); String prv = map.get(PRIVATE_KEY); if (pub == null || !Hex.isHex(pub)) { error("The bnd authentication URL public key for email %s is not a hex string %s", email, pub); return; } if (prv == null || !Hex.isHex(prv)) { error("The bnd authentication URL private key for email %s is not a hex string", email); return; } credentials(email, Hex.toByteArray(pub), Hex.toByteArray(prv)); } machine = map.get(MACHINE); }
private void startPoll() { Workspace ws = registry.getPlugin(Workspace.class); if ((ws != null) && (ws.getGestalt() .containsKey(Constants.GESTALT_BATCH) || ws.getGestalt() .containsKey(Constants.GESTALT_CI) || ws.getGestalt() .containsKey(Constants.GESTALT_OFFLINE))) { return; } int polltime = configuration.poll_time(DEFAULT_POLL_TIME); if (polltime > 0) { AtomicBoolean inPoll = new AtomicBoolean(); indexPoller = Processor.getScheduledExecutor() .scheduleAtFixedRate(() -> { if (inPoll.getAndSet(true)) return; try { poll(); } catch (Exception e) { reporter.error("Error when polling index for %s for change", this); } finally { inPoll.set(false); } }, polltime, polltime, TimeUnit.SECONDS); } }
private void startPoll() { Workspace ws = registry.getPlugin(Workspace.class); if ((ws != null) && (ws.getGestalt() .containsKey(Constants.GESTALT_BATCH) || ws.getGestalt() .containsKey(Constants.GESTALT_CI) || ws.getGestalt() .containsKey(Constants.GESTALT_OFFLINE))) { return; } int polltime = configuration.poll_time(DEFAULT_POLL_TIME); if (polltime > 0) { AtomicBoolean inPoll = new AtomicBoolean(); pomPoller = Processor.getScheduledExecutor() .scheduleAtFixedRate(() -> { if (inPoll.getAndSet(true)) return; try { poll(); } catch (Exception e) { reporter.exception(e, "Error when polling for %s for change", this); } finally { inPoll.set(false); } }, polltime, polltime, TimeUnit.SECONDS); } }
@Override public void setProperties(Map<String, String> map) throws Exception { super.setProperties(map); String email = map.get(EMAIL); if (email == null) { Settings settings = registry.getPlugin(Settings.class); email = settings.getEmail(); if (email == null) { error( "The bnd authentication URL connection handler has no email set as property, nor have the bnd settings been set"); return; } credentials(email, settings.getPublicKey(), settings.getPrivateKey()); } else { String pub = map.get(PUBLIC_KEY); String prv = map.get(PRIVATE_KEY); if (pub == null || !Hex.isHex(pub)) { error("The bnd authentication URL public key for email %s is not a hex string %s", email, pub); return; } if (prv == null || !Hex.isHex(prv)) { error("The bnd authentication URL private key for email %s is not a hex string", email); return; } credentials(email, Hex.toByteArray(pub), Hex.toByteArray(prv)); } machine = map.get(MACHINE); }
@Override public void setProperties(Map<String, String> map) throws Exception { super.setProperties(map); String email = map.get(EMAIL); if (email == null) { Settings settings = registry.getPlugin(Settings.class); email = settings.getEmail(); if (email == null) { error( "The bnd authentication URL connection handler has no email set as property, nor have the bnd settings been set"); return; } credentials(email, settings.getPublicKey(), settings.getPrivateKey()); } else { String pub = map.get(PUBLIC_KEY); String prv = map.get(PRIVATE_KEY); if (pub == null || !Hex.isHex(pub)) { error("The bnd authentication URL public key for email %s is not a hex string %s", email, pub); return; } if (prv == null || !Hex.isHex(prv)) { error("The bnd authentication URL private key for email %s is not a hex string", email); return; } credentials(email, Hex.toByteArray(pub), Hex.toByteArray(prv)); } machine = map.get(MACHINE); }